Question 20
Consider the following JavaScript code.
function add(x) { return function (y) { return x + y; };}
const addFive = add(5);console.log(addFive(10));What will be the output of the code snippet?
5
10
15
20
Consider the following JavaScript code.
function add(x) { return function (y) { return x + y; };}
const addFive = add(5);console.log(addFive(10));What will be the output of the code snippet?
5
10
15
20
Correct answer
15
Question 20 of 32 in the IIT Madras BS Modern Application Development II (MAD 2) End Term paper sat on 22 Dec 2024, in the September 2024 term (IIT M FOUNDATION DIPLOMA AN EXAM QDF3 22 Dec 2024). It carries 2 marks.