this for loop is producing an error: Unexpected identifier, why?
$(document).ready(function(){
$('#done').click(function(e){
var id = [];
id = $('.crewMember');
for(var i=0, i<id.length, i++){
console.log(id[i]);
}
});
});
You need to use semicolon (
;) instead of comma (,) inforloop syntax:The unexpected identifier is because it’s expecting multiple variables to be declared/assigned, but you are doing logical comparisons and incrementing.