3 ms·
I don't understand what let has to do with functional programming though (enclosing a variable within if () {} instead of function block etc). Do you mind elabo
by Kiro 12y ago
I don't understand what let has to do with functional programming though (enclosing a variable within if () {} instead of function block etc). Do you mind elaborating?
- coldtea 12y agoThe question wasn't about functional programming per se, but about lexical scope. "let" keyword in ES6 allows Javascript to have "lexical" style scoping (with some caveats due to JS legacy). That said, several ways of scoping a variable can be had in functional programming. Have a look here for some more explanation with regards to Common Lisp: http://stackoverflow.com/questions/463463/dynamic-and-lexical-variables-in-common-lisp http://stackoverflow.com/questions/463463/dynamic-and-lexica...