¡@

Home 

javascript Programming Glossary: old_index

Move an array element from one array position to another

http://stackoverflow.com/questions/5306680/move-an-array-element-from-one-array-position-to-another

success with this function Array.prototype.move function old_index new_index if new_index this.length var k new_index this.length.. this.push undefined this.splice new_index 0 this.splice old_index 1 0 return this for testing purposes Example code 1 2 3 .move.. array until we have the proper length. Then in this.splice old_index 1 0 we splice out the old element. splice returns the element..