Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@ProfAvery
Last active July 12, 2019 16:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save ProfAvery/8839069 to your computer and use it in GitHub Desktop.
Save ProfAvery/8839069 to your computer and use it in GitHub Desktop.
Using Underscore.js from the Node.js REPL
/*
Per <http://stackoverflow.com/questions/5691901/using-the-underscore-module-with-node-js>,
from the Node.js REPL, use two underscores (__) instead of a single underscore (_)
because Node uses _ for the last return value.
Note that if your program is in a file, you can still use a single underscore (_).
*/
var __ = require("underscore");
__.each([1, 2, 3], function(e) { console.log(e); });
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment