Advanced JavaScript (original) (raw)

What is the call stack in JavaScript?

What will the following code log?

JavaScript `

console.log(a); var a = 10;

`

Which of the following statements about closures is true?

What is the purpose of the 'this' keyword in the global execution context?

What will the following code log?

JavaScript `

function outer() { let a = 10; return function inner() { console.log(a); }; } const fn = outer(); fn();

`

What is a key feature of WeakMap in JavaScript?

What will the following generator function output?

JavaScript `

function* generator() { yield 1; yield 2; yield 3; } const gen = generator(); console.log(gen.next().value);

`

Which of the following is a characteristic of a pure function?

What is currying in functional programming?

What will the following code log?

JavaScript `

const n = [1, 2, 3]; const doubled = n.map((n) => n * 2); console.log(doubled);

`

There are 10 questions to complete.

Take a part in the ongoing discussion