DEV Community


Discussion on: JavaScript Quiz Part 2

nektro profile image
Meghan (she/her) • Edited
// #1
"hello".split("").reduce((c,v,i,a) => c + a[a.length-i-1], "");

// .slice returns a shallow copy of "substring" of elements in an Array
// .splice removes elements from elements at an index and can insert as well

This is a bit of a trick question and depends on what you're looking for, and @avalander went into a lot of detail for this