Ingeniero Ui Interview Questions

4,056 ingeniero ui interview questions shared by candidates

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

Interviewed at ValueLabs

4
Apr 30, 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

Interviewed at ValueLabs

4
Feb 16, 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

Viewing 1 - 10 interview questions

Glassdoor has 4,056 interview questions and reports from Ingeniero ui interviews. Prepare for your interview. Get hired. Love your job.