How can I make Javascript check an array and make sure that there\'s no error committed after the comma separating each element of the array .. For example a user may form an ar
Your second cars
example with the *
in it won't compile.
To check for double commas, you can iterate over the array and check for an undefined value.
for(var i = 0; i
Alternatively you could try and catch this before you generate the array. Is there a way to check for an empty row inputted by the user?