DEV Community

Rian Islam
Rian Islam

Posted on

Interview Quenstions Javscript

JavaScript is a scripting language. It is different from Java language. It is object-based, lightweight, cross-platform translated language. It is widely used for client-side validation. The JavaScript Translator (embedded in the browser) is responsible for translating the JavaScript code for the web browser.

List some of the advantages of JavaScript.

Some of the advantages of JavaScript are:

Server interaction is less
Feedback to the visitors is immediate
Interactivity is high
Interfaces are richer
Enter fullscreen mode Exit fullscreen mode

List some of the disadvantages of JavaScript.

Some of the disadvantages of JavaScript are:

No support for multithreading
No support for multiprocessing
Reading and writing of files is not allowed
No support for networking applications.
Enter fullscreen mode Exit fullscreen mode

Define anonymous function

It is a function that has no name. These functions are declared dynamically at runtime using the function operator instead of the function declaration. The function operator is more flexible than a function declaration. It can be easily used in the place of an expression. For example:

var display=function()  
{  
  alert("Anonymous Function is invoked");  
}  
display();  
Enter fullscreen mode Exit fullscreen mode

Define closure.

In JavaScript, we need closures when a variable which is defined outside the scope in reference is accessed from some inner scope.

var num = 10;  
function sum()   
{  
document.writeln(num+num);  
}   
sum();  
Enter fullscreen mode Exit fullscreen mode

What is ES6 or ECMAScript 2015?

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

Define Constants in ES6?
Enter fullscreen mode Exit fullscreen mode

In ES6, a constant is affirmed by a const keyword. ES6 provides a const keyword, which a constant uses and declare a const.

What do you mean by Babel?
Enter fullscreen mode Exit fullscreen mode

Babel is a JS Transpiler, which let us write in ES6 and interpret the work done in ES6 into ES5 which is supported by browsers.

Define undefined?
Enter fullscreen mode Exit fullscreen mode

In Javascript, undefined means, changeable is affirmed but doesnโ€™t hold value.

Define promises in ES6?
Enter fullscreen mode Exit fullscreen mode

In order to hold asynchronous encoding, promises transport a more precise way to apply async programming in JavaScript.

Explain map?
Enter fullscreen mode Exit fullscreen mode

The map can be distinct as elements that are stored as keys, or worth pairs. Objects or ancient values can be stored in the map as each key or value.

Define Set?
Enter fullscreen mode Exit fullscreen mode

Set is a compilation of sole values, in which photocopy values are ignored. All costs must be unique. Values can be thing references or primal types.

Top comments (1)

Collapse
 
amt8u profile image
amt8u

All the advantages and disadvantages mentioned are not language related. They are there because JS is being used within web browsers. Outside the browser such as nodejs runtime, JS is as powerful as other high level languages.