Some Javascript method Or Concepts That Essential for React Development

Naiem
2 min readNov 5, 2020

1. this :

this keyword is a familiar keyword who knows javascript. In this article, we will learn about what is this keyword in JavaScript, four different binding of “this” keyword, and about new keyword. In other words, every javascript function while executing has a reference to its current execution context, called this. Execution context means here is how the function is called.

2. Bind() :

The bind method creates a new function and sets the this keyword to the specified object.

3. Call ( ) :

The call method sets the this inside the function and immediately executes that function.

The difference between call() and bind() is that the call() sets the this keyword and executes the function immediately and it does not create a new copy of the function, while the bind() creates a copy of that function and sets the this keyword.

4. Apply ( ) :

The apply() method is similar to call(). The difference is that the apply() method accepts an array of arguments instead of comma-separated values.

Syntax:

function.apply(thisArg, [argumentsArr])

5. map() :

map() method is very important for react.js. map() is an alternative of for loop but more efficient. we can use map() only with an array map() is not useable with an object so it is the easiest way to traverse or access an array collection with the use of map() method.

6. find() :

The find() method returns the value of the first element in the provided array that satisfies the provided testing function. find() only useable with an array collection

7. filter() :

The filter() method returns the value of all elements in the provided array that satisfies the provided testing function. filter() also useable only with an array collection. The difference between find() and filter() is find() return only one value of the first element and filter() returns all value if provided condition is satisfies.

8. window object :

The window object is supported by all browsers. It represents the browser's window. All global JavaScript objects, functions, and variables automatically become members of the window object. Global variables are properties of the window object. Global functions are methods of the window object. Even the document object (of the HTML DOM) is a property of the window object

9. global variable :

A global variable is a variable with global scope that means accesses anywhere from the scope. we can access the global variables from outside of the block and declare outside of the function block. A global variable is common a common variable for all functions.

10. local variable :

When you use JavaScript, local variables are variables that are defined within functions. They have local scope, which means that they can only be used within the functions that define them

--

--

Naiem

I am Naiemul Islam. I am a professional web Developer