Prev Next

Angular / ES6 Interview questions

Could not find what you were looking for? send us the question and we would be happy to answer your question.

Difference between Named Exports and Default exports in ES6.

Named Exports can export multiple values and must use the exported name when importing.

Default Exports export a single value and can use any name when importing.

What is ES6 or ECMAScript 2015?

ES6 was released in June 2015 as the sixth edition of the language. Initially, it was named ES6 and later renamed to ECMAScript 2015. This edition includes several new features such as modules, iterators, class, arrow functions, for...of loop, promises, and many more. Brendan Eich developed it.

What is ECMAScript?

ECMAScript is a specification that is defined in the ECMA-262 standard to create a general-purpose scripting language.

Explain let and const keywords.

The variables declared using let keyword will be mutable and the values can be changed at anytime. It is similar to var keyword except that it provides block scoping.

The variables declared using the const keyword are immutable and block-scoped. The value of the variables cannot be changed or re-assigned.

Explain arrow function in ES6.

Arrow functions are the shorthand notation to write ES6 functions. The definition of the arrow function consists of parameters, followed by an arrow (=>) and the body of the function.

An Arrow function is also known as 'fat arrow' function. We cannot use them as constructors.

const functionName = (arg1, arg2) => {  
    //body of the function  
}  
«
»
DataStructures

Comments & Discussions