function wave(str){
return Array.from({length : str.length},
(v, i) => str.split("").map((e, k) => k == i ? e.toUpperCase() : e).join(""))
}
wave(“two words”) returns
[“Two words”,“tWo words”,“twO words”,“two words”,“two Words”,“two wOrds”,“two woRds”,“two worDs”,“two wordS”]
I’m trying to tweak my code so that the value at index 3, “two words”, is skipped?
i.e tweak the function within the .map() to simply return nothing when " " is evaluated.