What are the Data Types available in Javascript?
  • Number
  • String
  • BigInt
  • Null
  • Undefined
  • Boolean
  • Object
  • Array
What is the use of Typeof operator in Javascript?
    It is used to find the type of a JavaScript variable.

Difference between For and Foreach in Javascript?
For:
  • Original array of iterating over an array.
  • Faster performance.
  • A break statement can be used.

ForEach:
  • Newer way with lesser code to iterate over an array.
  • Slower performance.
  • A break cannot be used.
Difference between Array and Objects?
  • Arrays use numbered indexes.
  • Objects use named indexes.
When to Use Arrays. When to use Objects in Javascript?
  • JavaScript does not support associative arrays.
  • You should use objects when you want the element names to be strings (text).
  • You should use arrays when you want the element names to be numbers.
Array Methods:
  • toString() - converts array into a string of (csv) array values.
  • join() - it behaves like toString but in addition you can specify the separator.
  • pop() - removes the last element from an array.
  • push() - adds a new element to an array at the end.
  • shift() - removes the first array element.
  • unshift() - adds a new element to an array at the beginning.
  • slice() - create a new array and does not remove any element from the source array. It take two arguments like slice(1,2);
  • splice() - adds a new element to an array.
Javascript Sets:
    Set is a collection of unique values.Each value can only occur once in a Set.

use strict:
    Defines that JavaScript code should be executed in "strict mode".

Difference between sessionStorage and localStorage?
    sessionStorage is similar to localStorage; the difference is that while data in localStorage doesn't expire, data in sessionStorage is cleared when the page session ends.

What is the use of Call, Apply and Bind methods in Javascript?

    Call method calls the function with a given this value and allows you to pass in arguments one by one.
    Apply method calls the specified function with a given this value and allows you to pass in arguments as an array.
    Bind returns a new function, allowing you to pass in this array and any number of arguments.

What is Clousers in Javascript?

    A closure is a function having access to the parent scope, even after the parent function has closed.

What is Currying in Javascript?
    Currying is a checking method to make sure that you get everything you need before you proceed. It helps you to avoid passing the same variable again and again. It divides your function into multiple smaller functions that can handle one responsibility.

Difference between map and foreach in Javascript?
    map method returns a new array by applying the callback function on each element of an array, while the forEach method doesn't return anything.

What is use of Generator in Javascript?
    Yield keyword used to pause and resume a generator keyword.

What is Hoisting in javascript, How can we avoid it?
    Hoisting in JavaScript allows declarations to move to the top of their containing scope during compilation. To avoid hoisting issue, use Declare Variables and Functions Explicitly and Use Strict Mode.