JavaScript fucntions

Slice & Splice

function frankenSplice(arr1, arr2, n) {
var tmp = arr2.slice();
tmp.splice(n,0, arr1)
return tmp.flat();
}
frankenSplice([1, 2, 3], [4, 5, 6], 1);

 

 

Full information on JS can be obtained:

Javascript.info

Was this article helpful?

Related Articles

Leave A Comment?