Write the execution order of:
Math.sum([1,2,3, [1,2,3].length])
Answer:
1
// => 1
2
// => 2
3
// => 3
1
// => 1
2
// => 2
3
// => 3
[1,2,3]
// => [1,2,3]
[1,2,3].length
// => 3
Math.sum([1, 2, 3, 3])
// => 9
If you get stuck. Use the chrome debugger to test things out.
[1, 2, 3, 4 + 5].length
"hello".subString(0, 3).length
"hello".subString(0, 3 - 1).length + "world"
{ hello: "wor" + "ld" }