Some things about JavaScript

1. What are the possible ways to create objects in JavaScript?

There are many ways to create an object in JavaScript as below:

2. What is the difference between Call, Apply and Bind?

The difference between Call, Apply and Bind can be explained with below examples,

Output:

3. What is JSON and its common operations

JSON is a text-based data format following JavaScript object syntax, which was popularized by.Douglas Crockford It is useful when you want to transmit data across a network, and it is basically just a text file with an extension of .JSON.

4. What is the purpose of the array slice method

The slice() method returns the selected elements in an array as a new array object. It selects the elements starting at the given start argument, and ends at the given optional end argument without including the last element. If you omit the second argument then it selects till the end.

5. What is the purpose of the array splice method

The splice() method is used either adds/removes items to/from an array, and then returns the removed item. The first argument specifies the array position for insertion or deletion whereas the option second argument indicates the number of elements to be deleted. Each additional argument is added to the array.

6. What is the difference between slice and splice.

Some of the major difference in a tabular form

  1. Doesn’t modify the original array(immutable)
  2. Returns the subset of original array
  3. Used to pick the elements from array
  1. Modifies the original array(mutable)
  2. Returns the deleted elements as array
  3. Used to insert or delete elements to/from array

7. What is the difference between == and === operators

JavaScript provides both strict(===, !==) and type-converting(==, !=) equality comparison. The strict operators take the type of variable in consideration, while non-strict operators make type correction/conversion based upon values of variables. The strict operators follow the below conditions for different types,

  1. Two strings are strictly equal when they have the same sequence of characters, same length, and same characters in corresponding positions.
  2. Two numbers are strictly equal when they are numerically equal. i.e, having the same number value. There are two special cases in this,
  3. NaN is not equal to anything, including NaN.
  4. Positive and negative zeros are equal to one another.
  5. Two Boolean operands are strictly equal if both are true or both are false.
  6. Two objects are strictly equal if they refer to the same object.
  7. Null and Undefined types are not equal with ===, but equal with ==. i.e, null===undefined → false but null==undefined → true

8. What are lambda or arrow functions

An arrow function is a shorter syntax for a function expression and does not have its own this, arguments, super, or new.target. These functions are best suited for non-method functions, and they cannot be used as constructors.

9. What is IIFE(Immediately Invoked Function Expression)

IIFE (Immediately Invoked Function Expression) is a JavaScript function that runs as soon as it is defined. The signature of it would be as below,

10. What is a higher order function?

Higher-order function is a function that accepts another function as an argument or returns a function as a return value or both

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Ahad Hossain Aiman

Ahad Hossain Aiman

2 Followers

I am Aiman. I am a web developer. I can learn anything at any time. For that, I take the help of Google. My core skill is based on JavaScript .