Variables, Datatypes and Operators in JavaScript.
Datatypes in JavaScript:
Aug 13, 2023
Data of these types are stored and manipulate easily by using variables.
How to creates variables:
Numbers:
String:
Boolean:
Objects:
When we don’t assign any value to variable, It will give you undefined.
If we don’t want to store any data in our variable then we can assign a variable with an empty value called as ‘null’.
Operators:
- Operators are categorized into unary, binary, and ternary based on the number of operands on which they operate in an expression.
- “typeof” is an operator in javaScript.
Example of typeOf:
Equality Operator:
Concatenation Operator:
console.log("string: ","Hello" + " world!"); // string: Hello world!
Exponentiation Operator:
console.log("10**3", 10**3); // output 1000
Thanks…