I have the following array setup, i,e:
var myArray = new Array();
Using this array, I am creating a breadcrumb menu dynamically as the user add
You could use myArray.push('MenuA');
so you don't specify direct numbers when adding elements.
To remove an element I.E. 'MenuB':
// another quick way to define an array
myArray = ['MenuA', 'MenuB', 'MenuC', 'MenuD', 'MenuE'];
// remove an item by value:
myArray.splice(myArray.indexOf('MenuB'),1);
// push a new one on
myArray.push('MenuZ');
// myArray === ["MenuA", "MenuC", "MenuD", "MenuE", "MenuZ"]