3 ms·
> OP didn't redefine `err`, just assigned a new value to the `err` variable that was available as `catch`'s parameter. How would you define "redefine" if this
by e12e 5y ago
> OP didn't redefine `err`, just assigned a new value to the `err` variable that was available as `catch`'s parameter.
How would you define "redefine" if this isn't an example of redefining?
> the `return e` in your example works since `e` was hoisted when you defined it using `var e = err`. If you tried `return err` instead, it'd result in a `ReferenceError`.
Ok, thank you.