4 ms·
Looking forward to have the same feature in JavaScript! /sees the horror on the faces of all the lodash users/ Ok that was not a good idea
by jakub_g 10y ago
Looking forward to have the same feature in JavaScript!
/sees the horror on the faces of all the lodash users/
Ok that was not a good idea
- sratner 10y agoInterestingly, _ 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...