3 ms·
Interestingly, _ is already reserved in the node.js console, so you have to import lodash under a different name.
by sratner 10y ago
Interestingly, _ is already reserved in the node.js console, so you have to import lodash under a different name.
- Nullabillity 10y agoSeems to work fine for me. teo ~ node -v v7.3.0 teo ~ node > _ = "hi" Expression assignment to _ now disabled. 'hi' > _ 'hi'
- sratner 10y agoThat's a fluke ;) $ node > _ = "hi" 'hi' > _ 'hi' > foo = "bar" 'bar' > _ 'bar' (See mattnewton's reply for explanation.)
- Nullabillity 10y ago> _ = "hi" Expression assignment to _ now disabled. 'hi' > "bar" 'bar' > _ 'hi' > foo = "bar" 'bar' > _ 'hi'
- sratner 10y agoNeat, looks like newer versions detect and correct for it. TIL.
- mattnewton 10y agoIt's actually a magic variable that refers to the last expresion https://nodejs.org/api/repl.html#repl_assignment_of_the_underscore_variable https://nodejs.org/api/repl.html#repl_assignment_of_the_unde...