JavaScript Interview Notes

JavaScript Interview Notes

Learn JavaScript Concept in questionnaire way.

Q1) What is JavaScript ?

JavaScript is a programming language initially designed to interact with elements of web pages. In web browsers, JavaScript consists of three main parts:

  • ECMAScript that provides the core functionality.

  • The Document Object Model (DOM), which provides interfaces for interacting with elements on web pages

  • The Browser Object Model (BOM) provides the browser API for interacting with the web browser

The JavaScript engine is a program that executes JavaScript code. In the beginning, JavaScript engines were implemented as interpreters. However, modern JavaScript engines are typically implemented as just-in-time compilers that compile JavaScript code to bytecode for improved performance.

compiler vs Interpreter

https://www.guru99.com/difference-compiler-vs-interpreter.html

Q2) JavaScript Hoisting

Learn everything about hoisting :

kushalgupta.hashnode.dev/javascript-hoisting

Q3) What all are ES6 Features ?

1. Spread and Rest Operator

  • When ... is at the end of function parameters , it’s “rest parameters” and gathers the rest of the list of arguments into an array.
  • When ... occurs in a function call or alike, it’s called a “spread syntax” and expands an array into a comma separated values.
  • rest vs arguments :
  1. arguments are not having maps, filter method like rest. arguments is a array-like object where rest is pure array hence having all features of array object.
  2. partial parameter is possible with rest but arguments catch by default all arguments
  • copy to new object/array using spread operator : newObject = {...oldObject}

Above is just an outline, I suggest you to read comprehensive points on operators from below link :

https://javascript.info/rest-parameters-spread


other concepts are coming soon.............

Reference : javascripttutorial.net Reference : javascript.info