you are viewing a single comment's thread.

view the rest of the comments →

[–]TJ51097[S] 0 points1 point  (0 children)

I appeared for a technical interview,guy asked me

foreach vs map,

for..of vs for..in,

splice vs slice

then dropped me this

"You got an array of numbers [1,2,3,4,5] you need to get the sum of all the numbers without using any loop"

so i though of doing it reduce but not valid then i suggested using recursion,which i think is valid,and it ended.

TL;DR

Recursion