#JS from Start- Data types in JavaScript
There are various types of data in JavaScript, but the mains are the Primitive data and Reference data.
There are lots of things to say about primitive and reference but I don’t want to confuse you. Primitive Data Types are data that are stored directly on the stack. This means when you access primitive data, you access it by its values. Reference data are accessed by reference and stored on the heap of the memory.
Primitive data
- String (Letters, numbers, symbols and a few others.)
- Boolean
- Number(Integals, decimals, float are all numbers)
- Undefined
- Null
- Symbols (Introduced in ES6)
Reference Data
- Arrays
- Object Literals
- Dates
- Functions
- Others
So, we will start by creating some variables with different types.
PRIMITIVE DATA TYPES
String
Number
Boolean
Null
The output here is object, but Null is not an Object. It is mistake in the JavaScript. It is a primitive.
Undefined
Symbols
REFERENCE DATE TYPES
All reference types are object.
Array
Object Literal
Date
I will stop here now. I will talk about functions at a better applicable section and we will loot at Type conversion on Saturday.
Thank you!
Leave #JS from Start- Data types in JavaScript to:
Read more #jsfromstart posts
Best Posts From tykee
We have not curated any of tykee's posts yet. But you can encourage our curation team to review posts by visiting them regularly and by referring other readers. Because we give priority to frequently read content.
More Posts From tykee
- Hive is still beautiful
- The Good n Ugly of Cryptos
- Bug Hunting and Suggestion (70 Hive Bounty)
- Biggest Life Error you can make as a Crypto trader.
- Life and purpose
- My Recent Macbook pro experience.
- Bug Report (a Click on Profile picture)
- Cryptos, My environment and I.
- Some Facts about Cryptocurrency - Add Yours in the comment
- Crypto: Nigerian Govt are bunch of a mess.
- Have a consistent income before dabbling to the crypto space.
- When things fails for too long, change the pattern.
- Successful Cryptocurrency Investing: Wisdom over Wealth
- The 4-Hour Rule for Achieving World-Class Skills
- Why Fundamental Analysis Trumps Technical Analysis in Crypto Trading
- Embrace New Skills for Tomorrow's World
- Easiest way to grow.
- Hey guy
- Crypto Rollercoster (TIME)
- Hey Yoo!