Skip to content
Malexion edited this page Oct 31, 2016 · 1 revision

__.scope(func)

  • func Function to enclose.

Examples

// Just wanted a prettier looking enclosure rather than (function() { ... })();
var joinPaths = __.scope(() => {
   var template = '{0}/{1}';

   return (p1, p2) => template.format(p1, p2);
});

console.log(joinPaths('foo', 'bar'));
Clone this wiki locally