Skip to content

Instantly share code, notes, and snippets.

@ravid7000
ravid7000 / Javascript_interview_questions.md
Last active January 7, 2020 12:06
Popular JavaScript Interview Questions.

Popular JavaScript Interview Questions.

Question #1. What will be the output of following code?

Note: A closure is basically when an inner function has access to variables outside of its scope. Closures can be used for things like implementing privacy and creating function factories.

  const arr = [10, 12, 15, 21];
  for (var i = 0; i < arr.length; i++) {
    setTimeout(function() {