Question: Given the code below: function f(x) { return function (y) { x += A; return function () { y += B; return [x, y];

Given the code below: function f(x) { return function (y) { x

Given the code below: function f(x) { return function (y) { x += A; return function () { y += B; return [x, y]; } } } let g = f(0); let a = g(0)(); let b = g(0)(); console.log([a[0]+b[0], a[1]+b[1]]); Assume the output of the program is [6, 54], what is the value of 100*A+B?

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Lets analyze the code step by step 1 The function fx is defined which takes one parameter x It retur... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!