Elance Exams Answers PDF file

-- PDF FILE --
Download PDF file of elance Zoho Creator Exam Answers

The loop isn't working. What's the problem? <code> var foos = ['a', 'b', 'c' , 'd', 'e']; var bars = ['x', 'y', 'z']; for (var i = 0; i < foos.length; i++) { var foo = foos[i]; for (var i = 0; i < bars.length; i++) { var bar = bars[i]; /* some code using `bar` */ } } </code>

The inner loop resets the outer for-loop, leaving it a fixed position each time, causing an infinite loop (hint: no block scope).
The outer-loop finishes after the first iteration due to a "bug" that unfortunately is part of the ECMAScript specification.
Uncaught SyntaxError.
There is no bug. The loop will run correctly.
  • Follows us our servcies
  • Facebook icon
  • Linkedin icon
  • twitter icon
  • rss icon
  • social icon