JavaScript>data type>cheatsheet
what is a data type?
data type is basically specifies what kind of data can be stored and manipulated with the program.
7 types of data types as listed below:
Primiative data types
- What are strings?
Strings are a primitive data type. They are any grouping of characters surrounded by single quote ' or double quotes ".
- letters
- spaces
- numbers
- symbols
- What are numbers?
Numbers are a primitive data type.
They include the set of all integers and floating point numbers.examples)
let amount = 6;
let price = 4.99;
- What is a boolean?
true or false
- What is the difference between null and undefined?
Null is a primitive data type.
It represents the intentional absence of value.
It is represented as null.example)
let x = null;
Undefined is a primitive JavaScirpt value that represents lack of defined value.
Variables that are declared but not initialized to a value will take the value undefined. example)
var a;
console.log(a); // Output: undefined
===================== ... to be continued...
-
What is an object?
-
What is an array?
-
What is a function?