The following is an example of Let variable:
The following is an example of Const variable:
var variable is commonly used in ES5. it’s freedom of declaration and no restriction. It’s accessible from any block and anywhere.
The following is an example of a variable:
There are 3 ways to create objects.
- By object literal
- By creating an instance of Object directly (using new keyword)
- By using an object constructor (using new keyword)
The following is an example of Objects:
The following is an example of Arrays:
The following is an example of Functions:
The following is an example of Recursive Functions:
The following is an example of Inner Functions:
The following is an example of Numbers:
The following is an example of Strings:
The following is an example of Operators:
Boolean is a data type that returns two values i.e true and false. It’s used at conditional statements (if-else, switch, while, do…while).