7 most important topics of JavaScript

JavaScript is a lightweight, interpreted programming language with object-oriented capabilities that allows you to build interactivity into otherwise static HTML pages. The general-purpose core of the language has been embedded in Netscape, Internet Explorer, and other web browsers

Today I discuss some important topics of javascript that you must be known. let’s begin….

Undefine

Undefine is a javascript primitive value. For various reasons, we find the variable as an undefine type. Some reasons are given below:

i) If you define a variable but not assign value.

ii) Write a function without return any value.

iii) Want to access an object property which is not exist

iv) If you directly assign undefine as a variable value.

v) If you want to access value from array index but this index does not exist.

Double Equal (==) and Triple Equal (===)

i)When you use double equal in a conditional statement to compare two variables, javascript convert them in the same data type then compare them. Let’s see an example….

ii) When you use triple equal in a conditional statement to compare two variables, JavaScript not one check value but also check variable type. let’s see the same example …

Block Scope

In ES6, const let and var keywords allow developers to declare variables. Let and const is block scope. which means those variables exist only within the corresponding block.

slice()

slice() is a built-in method that returns the selected element in an array. let’s see how does slice() method work…

splice()

splice()is a built-in method that adds/remove an item to/from an array and returns the removed item.

map()

map() is a JavaScript built-in method that creates a new array with the results of calling a function for every array element. let’s see an example …

filter()

filter() method creates an array filled with all array elements that pass the test implemented by the provided function.