Think With Modern and Advance JavaScript.

AJ Auntor ES6 Blog

There are many versions of JavaScript. But today I gonna discuss about special ES6 or ECMAScript 6 as well as some advance features of JavaScript .

01. What is ES6 ?

02. Arrow Function definition.

Let’s See the Example:
-
We write the ES5 function expression such as :
var myFunction = function() {
console.log(‘A Normal Function’);
}

-If you write the code in the arrow function:
const myFunction = () => console.log(‘ ES6 Arrow Function’);

03. How works spread operator and what it is ?

If I say in one line, what is spread operator ?
The spread operator is actually (…) these three dots.

04. block binding JavaScript.

function myFunction(condition) {    if (condition) {
var value = 321; return value;
} else { // statement
} // value will exists with a value of undefined
}

Block-Level:
lock-level declarations are that declare variables that are inaccessible outside of given block scope.
- Inside of a function
- Inside of a block (indicated by the { and } characters.)

05. ES6 MAP.

Don’t make mistake to think this map is Google map.
The map we will talk about here today is a data structure. Introduced to developers in the ES6 version of JavaScript. But it is a little different from the object type data structure. It has its own method, some features of its own. Maps can simultaneously accept all kinds of data such as functions, booleans, integers, characters and strings.

06. “this” is very confusing in JavaScript.

The value of “this” is usually determined based on how a function is being called. And its value is determined at the time of execution.

Still Feeling confusing?
Just remember the following four rules that can be used to determine the value of this:
1. Global Rules
2. Object Rules
3. Clear Rules
4. new Keyword Rules

Global Rules: If you use “this ”keyword anywhere, except inside any of your custom defined objects, it will always indicate your global object. In the case of browsers, the global object is the window object. In other environments such as node JS, the object is global.

Object Rules: Now if you custom define an object and use this keyword inside it, its value will not indicate the global object anymore. Here its value will change.

Clear Rules: You may have heard of call, bind, apply method. These are actually used to set the value of this keyword explicitly. If you see that these have been used somewhere, you can easily catch who this keyword is indicating. Because using these call, bind, apply methods, it is possible to set who this keyword will indicate in the first parameter.

New Keyword Rules: Another keyword that is final but widely used can determine the value of new and this keyword. If this is somehow under this new keyword, its value may be different.

07. JavaScript function Constructor.

“The function constructor is also used to create a blueprint of the object in the same way as the class.”

08. JavaScript Inheritance details.

Inheritance can be of several types:
01. Prototype based inheritance.
02. Constructor Inheritance etc.

09. Some Extra thing about ES6.

However, two more new keywords are coming to ES6, let and const. There is no reason to be afraid of adding more new keywords, as they have nothing to do with the data type as always. You can use them to declare any type of data. But the main difference is in their behavior. In the first two new keywords, we can say that it is a bit like var. But const is a little different. For example, if we want, we can declare a variable with var and then we can change its value if we want, which is also possible in the case of let.

10. ‍What is cross browser testing and Why?

You need to work about:
- All other browsers that you use regularly on your devices, including older version browsers such as Internet Explorer, Opera mini that some people might still be using, which not support all the latest update, Such as CSS and all of JavaScript features.

Software Engineer (Front End)