Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Javascript interview questions

588 views

Published on

Javascript interview questions

Published in: Engineering
  • Hi there! I just wanted to share a list of sites that helped me a lot during my studies: .................................................................................................................................... www.EssayWrite.best - Write an essay .................................................................................................................................... www.LitReview.xyz - Summary of books .................................................................................................................................... www.Coursework.best - Online coursework .................................................................................................................................... www.Dissertations.me - proquest dissertations .................................................................................................................................... www.ReMovie.club - Movies reviews .................................................................................................................................... www.WebSlides.vip - Best powerpoint presentations .................................................................................................................................... www.WritePaper.info - Write a research paper .................................................................................................................................... www.EddyHelp.com - Homework help online .................................................................................................................................... www.MyResumeHelp.net - Professional resume writing service .................................................................................................................................. www.HelpWriting.net - Help with writing any papers ......................................................................................................................................... Save so as not to lose
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • Be the first to like this

Javascript interview questions

  1. 1. © 2013 www.Codelect.net JavaScript Interview Questions 1. What will the value of x.member be after executing the script below? var x = new Number(10); function foo(z) { var tmp = z; function bar(y) { x.member = x.member ? x.member + 1 : 1; x.member += y+tmp; } bar(30); } new foo(10); Answers: a. Run time error - the object Number does not have a property named member b. 50 c. 41 d. Run time error - the function bar cannot access variable tmp 2. What will the following script alert? function createList(list) { var result = []; for (var i = 0; i < list.length; i++) { var item = 'item' + list[i];
  2. 2. © 2013 www.Codelect.net result.push( function() {alert(item + ' ' + list[i])} ); } return result; } function foo() { var list = createList([1,2,3]); for (var j = 0; j < list.length; j++) { list[j](); } } foo(); Answers: a. item1 1 item2 2 item3 3 b. Run time error - you cannot push functions into array. c. item3 undefined item3 undefined item3 undefined d. Run time error - result is not initialized properly (using new array)
  3. 3. ҧ © 2013 www.Codelect.net Copy protected with Online-PDF-NoCopy.com

×