JavaScript Data Types
JavaScript Data Types
UP THE
KNOWLEDG
E!
Presentation by
Ma’am Ali
attendanc
e check!
Prayer
Find the
impostor!
Guess which among the crewmates
given is the impostor for each level.
Analyze and use your previous
knowledge to catch different the
impostors!
There is an impostor among
APPLE us!
ORANGE
GRAPES LETTUC
impostor
E
There is an impostor among
-= us! /=
&=
impostor **=
|=
impostor
There is an impostor among
Bitwise Logical
OR AND
impostor
Decrement
There is an impostor among
let x = 10;
impostor
let text =
"Hello"; text += "
x |= 5;
World";
You
did
well!
Learner’s data
Operations
It is a series of characters that are
surrounded by quotes in
JavaScript.
Strings
A data type in JavaScript that has
only two values which are true and
false.
Booleans
A data type in JavaScript includes
both integers and floating-point
numbers.
Number
These are key-value pairs used to
store data, created with {} or the
new keyword.
Object
A variable that has been declared
but not initialized with a value
which means the variable exists,
but it has no value assigned to it.
Undefined
It is a built-in object that provides
a way to represent whole numbers
greater than 2 .53
bigint
GREAT JOB!
Code Breaker
Undefined
Primitive data types
All types except Object define
immutable values represented directly
at the lowest level of the language. In
JavaScript, a primitive (value, data type)
is data that is not an object and has no
methods or properties.
An immutable value is one whose
content cannot be changed without
creating an entirely new value.
Syntax
Number
The Number
data type in
JavaScript
includes both
• integers and
Integers: Whole numbers
floating-point
without a decimal point, such as
1, 42,numbers.
or -7.
• Floating-point numbers: Result
Numbers with a decimal point,
such as 3.14, -0.001, or 2.71828.
BigInts are represented by appending
an "n" to the integer literal: The "n"
BigInt suffix is a type identifier that tells
JavaScript to interpret the number as a
BigInt is a built-in In JavaScript,
BigInt, all numbers
enabling are
it stored
to in
handle a 64-bit floating-
arbitrarily
point format (IEEE 754 standard).
large integers.With this standard, large
object that provides
integer cannot be exactly represented and will be
a way to represent rounded.
whole numbers
greater than 253. The Because of this, JavaScript can only safely represent
largest number that integers:
JavaScript can Up to 9007199254740991 +( 2 53
-1); and
reliably represent Down to -9007199254740991 -( 2 53
-1).
with the Number
Integer values outside this range lose precision.
primitive is 2 .
53
String
A String in
JavaScript is a
series of
characters that
• are surrounded
Template literals are literals
by quotes.
delimited with backtick (`)
characters, allowing for multi-line
strings, string interpolation with
embedded expressions, and
special constructs called tagged
templates.
Syntax
Syntax
Boolean
The
Boolean
data type
represents
a logical
entity and
is
inhabited
by two
values:
Syntax
Comparisons and Conditions
Comparison operators are used in logical
statements to determine equality or difference
between variables or values.
JavaScript includes non-primitive data types, such as objects, which can store
collections of data or more complex entities like arrays, functions, and custom objects.
The typeof operator is essential for checking a variable's data type, which helps
identify values during debugging or coding
Output 3.3
“personal portfolio”
Instructions:
Write a syntax that stores portfolio details
in variables. Output all information in a
formatted way with the help of different
data types.
Ensure to prepare outputs for the coding
and result
(Variable declaration and Portfolio details)
Variables to be used:
• STRINGS – full name (LS, FN, MI), nickname
• NUMBER – age, output number
• BOOLEAN – Is a student
• UNDEFINED – project title
• NULL – project score
• SYMBOL – LRN id
• OBJECT – crush {name, age}, pet {name, breed, color,
gender}