Array Based Questions:-

Question: Function Expression & Hoisting

console.log(add(10, 20));

var add = function(a, b) {
  return a + b;
};

Tasks:

  1. Predict the output.
  2. Explain why this output occurs.
  3. Convert it into a working version without changing function expression