Hello, Space Explorer! Today, we're going to delve into JavaScript data types. Think of data types as different celestial objects in our universe, each with its unique properties and uses. We'll explore five core JavaScript data types — Number
, String
, Boolean
, null
, and undefined
.
In JavaScript, data types are categorized based on their characteristics. Understanding this is like realizing the Earth is a planet, not a star or asteroid. This knowledge helps us predict behaviors in different situations.
First, we're going to discover numerical values through the Number
data type, which stores numbers such as 10
(integer numbers) or -2.19
(floating point numbers, i.e., numbers with a decimal point). Let's visualize it:
Upon running this code, you'll see 8
and 3.52
printed — the values of our declared and variables.
