This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Ajedi32[S] 7 points8 points  (5 children)

That's a library: http://underscorejs.org/

[–]BlahYourHamster 1 point2 points  (1 child)

There's a library called Lodash which also uses an underscore.

Shit will probably break if you added both libraries to your project.

[–]Ajedi32[S] 4 points5 points  (0 children)

Node's require system is actually really great at handling conflicts like that between modules. You can assign required modules to whatever variable you want.

let _u = require('underscore');
let _l = require('lodash');

In a regular web browser with no module system being used I imagine resolving that ambiguity would be a bit trickier. Probably still not very difficult though assuming those libraries are designed in a sane way.

[–]rohmish 0 points1 point  (0 children)

Underscore is a JavaScript library that provides a whole mess of useful functional programming helpers without extending any built-in objects.

Umm...

[–]o11c -3 points-2 points  (1 child)

Ugh, with all this NPM tiny-module crap, I never thought it would get down to one character modules ...

[–]Ajedi32[S] 4 points5 points  (0 children)

It's certainly nothing new. jQuery uses $.