Pergunta de entrevista da empresa Ignite Solutions

function weird(x) { var tmp = 3; return function(y) { return x + y + ++tmp; } } var funny = weird(2); var final_answer = funny(10); What is the value of final_answer at the end of this snippet? Please explain your answer

Resposta da entrevista

Sigiloso

8 de mar. de 2020

var funny returns function (y) { return x + y + ++tmp; } var final_answer returns 16