Could anyone help explain why length is returning 0? Thank you VERY much in advance!
var errors = [];
errors[\'\'] = \"Monday Morning slot already taken. Wou
Your Array needs a numeric input, you're currently using an empty string as an Index, which is invalid.
You can either specify an index, initialise the Array with your given elements, or push that item to the Array:
// Option 1: Specify index
var errors = [];
errors[0] = 'Monday Morning slot already taken. Would you like to replace it?';
// Options 2: Initialise the Array with values
var errors = ['Monday Morning slot already taken. Would you like to replace it?'];
// Option 3: Push the item to Array
var errors = [];
var myString = 'Monday Morning slot already taken. Would you like to replace it?';
errors.push(myString);