Sign in
Log inSign up

Javascript Fundamentals you should know about it

Sohel Rana's photo
Sohel Rana
·May 8, 2021·

3 min read

introduction: javascript is a programming language. if you are a beginner in javascript you must need some build-in method and some important things. Now I am going to tell you some important methods and some important things in javascript. so let's get start it.

1.difference between == and === assignment operator: these are very important operators to do the mathematical operations in javascript. some time we need to compare between two or more value is equal or not. then we need to use this all method. when we will use == equal then its operator can't check their data type.for example you want to compare between 5 and "5" string then the == equal method will return true, because it's doesn't check the data type. if you use === triple equal then it will check their value and data type also. then 5 and "5" string is not equal.

2.this keyword: this keyword is most important in javascript language. when you need to use class and some property under the class then you must need to use this keyword to reffer this class object.actually this keyword is very critical topic in javascript.it's depend on where you are using it.to access the class property you need to use this keyword.if you print this keyword it will show a window object.

3.map(): the map method is very important in javascript. map method is used to traverse one by one element of the array.it's something like that a for a loop. when we used a map in an array.it's traverse all array element by a single item at a time.

4.filter(): filter method use for filter data item of the array. you can filter array items by using specific data. after the data filter you can do anything with this data.it depends up to you.

5.scope: as javascript developer.you must know about scope. the scope is very important in javascript. there is especially two type scope the one is the local scope and the second is global scope. you can't access local scope variable, function or object or any property outside of there local scope. suppose you declare a variable inside a function. then only you can access this value and property inside the function.global property you can access and use from anywhere.

7.null vs undefined: in a programming case, you will need to use null and undefined in your program. null means there is no available value.data type of also null.when you create a variable but don't want to set the value of the variable.but you can set the value of the null variable when you need it. then you can set the null value. undefined data type also undefined.supposed you declare a variable and don't to set any value of it. then you can use undefined. basically, it's use case varies rare.

8.new keyword: the new keyword is very important when you create a class and you and create an object of the class.it's used for especially to create an object of a class. and also has some use cases of new keywords in javascript.