Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

js array take a elemt to front

let data = [0, 1, 2, 3, 4, 5];
let index = 3;
data.unshift(data.splice(index, 1)[0]);
// data = [3, 0, 1, 2, 4, 5]
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #js #array #elemt #front
ADD COMMENT
Topic
Name
7+8 =