Preguntas de entrevistas para Ui Engineer

4.056 Preguntas de entrevista compartidas por los candidatos | ui engineer

You have two methods: one method takes long time to run and the other completes in short time. You execute the long method first and after that you execute the short method. Which one will complete first. There is no setTimeout involved.
avatar

Senior UI Developer

Entrevista realizada en ValueLabs

4
30 de abr de 2015

You have two methods: one method takes long time to run and the other completes in short time. You execute the long method first and after that you execute the short method. Which one will complete first. There is no setTimeout involved.

What is the output of below program. var a = [1,2,3,4] for (var i=0; i<a.length; i++){ setTimeout(function(){ console.log(i) },1000) } ( My Ans : it will print 4 5 times as it will store the latest reference) Next They asked me : How can i print 1,2,3,4 by changing some code in above example
avatar

Senior UI Developer

Entrevista realizada en ValueLabs

4
16 de feb de 2018

What is the output of below program. var a = [1,2,3,4] for (var i=0; i<a.length; i++){ setTimeout(function(){ console.log(i) },1000) } ( My Ans : it will print 4 5 times as it will store the latest reference) Next They asked me : How can i print 1,2,3,4 by changing some code in above example

Viendo 1 - 10 de preguntas de entrevista

Glassdoor cuenta con 4.056 preguntas e informes de entrevistas obtenidos de entrevistas de Ui engineer. Prepárate para la tuya. Obtén un empleo. Ama tu empleo.