r/javaScriptStudyGroup • u/foolishcow360 • May 01 '18
Can someone help me with this question? I don’t see the relation between the console log numbers and the expected output
2
Upvotes
2
u/mitwilsch May 02 '18
It must be using the previous numbers in some way. Any more context to the problem? Are you expected to use some math function like fibonacci or prime numbers?
1
1
4
u/niallqball May 02 '18
f(1) = 0
f(2) = 0+ 1
f(3) = 0+1+2
f(4)= 0+1+2+3
f(10)= 0+1+2+3+4+5+6+7+8+9