3 ms·
This is true for the most part, but there's a subtle edge case. Within a nested function, variables used in loops will redeclare within the inner function: -
by geraldalewis 15y ago
This is true for the most part, but there's a subtle edge case. Within a nested function, variables used in loops will redeclare within the inner function:
->
outerVar = "outer"
->
# this will output "undefined"
# as CoffeeScript has redeclared it for the loop:
console.log outerVar
0 for outerVar in [0]
- jashkenas 15y agoHuh -- that looks like a (new) bug to me. We should reuse the external declaration.