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 array with two commas in a row separating an element instead of one comma .. Not just comma , any other wrong input.
var cars=["Saab",,"Volvo","BMW"]; // Here , this array has an error , there's a double comma .
var cars=["Saab",*"Volvo","BMW"]; // this array has an error , there's an asterix.
var cars=["Saab","Volvo","BMW"]; // this array is the right one.
Here's the wrong array
What Javascript function or solution could I use to make sure an array is checked and no error is within it .. Only elements and separating commas with no space in between.
Your help would be so much appreciated.
