12/13 syntax problem?


#1

var names=["a","b","c","d","e"];
for (var i = 0; i < 5; i++1){
console.log("I know someone called "+names[i]);
}

keeps saying syntax problem
thanks


#2

@gigarunner98221,
Either you use

(var i = 0; i < 5; i= i+ 1){

or

(var i = 0; i < 5; i++)

=========================================

You could also have used

(var i = 0; i < names.length; i++)

google search
== the Book ==
the for-loop:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/for
javascript array site:developer.mozilla.org
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array

== discussions / opinions ==
javascript array explained site:stackoverflow.com
http://stackoverflow.com/questions/3010840/loop-through-array-in-javascript
http://stackoverflow.com/questions/23305551/how-would-you-explain-javascript-typed-arrays-to-someone-with-no-programming-exp

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Comparison_Operators
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Expressions_and_Operators

== guidance ==
www.crockford.com
http://javascript.crockford.com/survey.html
http://javascript.crockford.com/code.html <<< Javascript coding conventions


#3

@gigarunner98221,
Updated prior Post...