When ES2016 was introduced, it had two new ways of defining variables called let and const. Earlier, in JavaScript you could only define variables using var. Var var is function-scoped or globally scoped. var which is declared outside of the function-scope is available to use by the entire web page. Function-scope means when declared inside […]
A Guide To Operators In JavaScript
An operator performs operation on one or multiple values and build result. There are 5 categories of operators. Comparison Operators Arithmetic Operators Assignment Operators Conditional Operators Logical Operators Comparison Operators This list of operators always requires two operands and returns a boolean value as the result. Operators Description == equal to === matches value and […]
Important Data Types in JavaScript
Data type means the type of data which can be stored and used in a program. There are 6 data types in JavaScript. There are mainly three categories which data types can be divided into: Primitive Data Types – This includes string, number and boolean. It holds only one value at a time. Reference Data […]
null Vs undefined in JavaScript
It is very important to know that both are data types in JavaScript. Null is an assigned value to the variable whereas undefined is a variable which is declared but its value has not been assigned. When you do not declare the value, JavaScript assigns the value “undefined”. Let’s talk about the similarities between null […]