v1
4/24/2020 by Lamik 4/24/202000
Setup HTML - click to add setup HTML
disable setup JavaScript
Setup JavaScript
let arr = ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j"];
let i = 5;
let el = "NEW";
delete caserun single casemove downdrag and drop case


ready



arr.splice(i, 0, el);
delete caserun single casemove upmove downdrag and drop case


ready



Array.prototype.splice.apply(arr, [i, 0, el]);
delete caserun single casemove upmove downdrag and drop case


ready



Array.prototype.splice.call(arr, i, 0, el);
delete caserun single casemove upmove downdrag and drop case


ready



arr.slice(0, i).concat(el, arr.slice(i));
delete caserun single casemove upmove downdrag and drop case


ready



[...arr.slice(0, i), el, ...arr.slice(i)]
delete caserun single casemove updrag and drop case


ready



arr.reduce((s, a, j)=> (j-i ? s.push(a) : s.push(el, a), s), []);
Test Case - click to add another test case
Teardown JS - click to add teardown JavaScript
Output (DOM) - click to monitor output (DOM) while test is running
RUN