To avoid using temp you can use the array destructuring to reverse the values like so `[arr[left], arr[right]] = [arr[right], arr[left]]`. Great content BTW see you tomorrow.
NeniEmSu
The recursive solution and the array map/pop version even more are perfect examples how to turn javascript into perl. One liners with the arrow function short syntax and trickery become completely unreadable.
For years everyone and their debug buddy were complaining about the bad syntax of perl and regular expressions. Yet with every new version JS and PHP are getting more and more cryptic. I find this extremely funny, , ,
chrishuhn
I think for the resolution from 9th minute, instead of putting the letter at index 0 at the end of input, you've to put it at the index of your iterator starting from the end so first iterate the h at input.length-1 (-1-i with i=0), 2nd iterate e at input.length-2 (-1-i with i=1), 3rd iterate l at input.length-3 (-1-i with i=2)...
louptreize
🦎>>reverse 2020 >>2020 ==Deadly
nivasff
Some would argue that transforming the string to an array is a new variable, thus not making it "in-place". ^_^
TheLoGgIDK
why you stop making these js algorithms videos these are awesome please continue this series and new persons should learn everything from you
onlinetechnology
I'm still here, just so you know
themudreco
this is a one liner "idol".split('').reduce((a, b) => b+a)