Pergunta de entrevista da empresa NRG Edge

Define and write a closure in javascript to protect a variable during nested iterations.