Pergunta de entrevista da empresa Trax Retail

Asked me about the company, what do I know. 2 technicals questions. first was some code in JavaScript. what will be the output? he used setTimeout method in a loop. and print the "var i" variable... for(var i=0;i<10;i++) setTimeout(() => console.log(i), 0) console.log("10"); so the output would be 11 times 10. the next question was about given a sorted array. I suppose to print randomly all numbers in an array in an efficient way.