JavaScript's utility _ belt (by jashkenas)

Underscore Alternatives

Similar projects and alternatives to underscore

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a better underscore alternative or higher similarity.

underscore reviews and mentions

Posts with mentions or reviews of underscore. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2022-09-08.
  • Not Your Grandfather’s Perl
    7 projects | news.ycombinator.com | 8 Sep 2022
  • Yoda Conditions (From the office)
    6 projects | dev.to | 28 Jul 2022
  • Top 7 template engines for Node JS 2022
    5 projects | dev.to | 7 Jul 2022
    Its GitHub repository is https://github.com/jashkenas/underscore. Companies are used by large companies like Pinterest, Tesla Motors, Figma, Coursera, PostMan, Reddit, LinkedIn, Tumblr, Alibaba, Hulu, and more.
  • Unde as putea gasi exercitii de sortare a listelor in javascript pentru interviu de frontend?
    2 projects | reddit.com/r/programare | 26 Jun 2022
  • Discovered a 63kb tiddlywiki like self saving HTML+JS wiki and its looking cool
    10 projects | news.ycombinator.com | 22 May 2022
  • What does it mean this function removeItem = (item) => { _.remove(this.items, item); };inside this class? And anyone knows why there is an underscore before the method?
    2 projects | reddit.com/r/learnjavascript | 19 May 2022
    That’s a function from the underscore library which can be found here: https://www.npmjs.com/package/underscore
  • Asking Functional vs Class components again.
    4 projects | reddit.com/r/react | 28 Apr 2022
    There are many functional libraries for js like underscore, ramda, or even ts specific ones like fp-ts.
  • How to detect scroll direction in vanilla JavaScript (to make a goofy logo animation)
    2 projects | dev.to | 13 Apr 2022
    /* Source: https://underscorejs.org/underscore-esm.js During a given window of time. Normally, the throttled function will run as much as it can, without ever going more than once per `wait` duration; but if you'd like to disable the execution on the leading edge, pass `{leading: false}`. To disable execution on the trailing edge, ditto. */ function throttle(func, wait, options) { var timeout, context, args, result; var previous = 0; if (!options) options = {}; var later = function () { previous = options.leading === false ? 0 : Date.now(); timeout = null; result = func.apply(context, args); if (!timeout) context = args = null; }; var throttled = function () { var _now = Date.now(); if (!previous && options.leading === false) previous = _now; var remaining = wait - (_now - previous); context = this; args = arguments; if (remaining <= 0 || remaining > wait) { if (timeout) { clearTimeout(timeout); timeout = null; } previous = _now; result = func.apply(context, args); if (!timeout) context = args = null; } else if (!timeout && options.trailing !== false) { timeout = setTimeout(later, remaining); } return result; }; throttled.cancel = function () { clearTimeout(timeout); previous = 0; timeout = context = args = null; }; return throttled; }
  • Modern PHP
    10 projects | news.ycombinator.com | 27 Mar 2022
    All these features have been discussed countless times in "new release" threads and such, but I don't think I ever asked public opinion on the "spaceship" operator, so I want to raise the question this time. I always ignored it as a feature that I personally don't need, but somebody else does, so ok, whatever.

    You see, I actually don't think I ever used usort in about 10 years (or how long is it since anonymous functions were introduced). Instead, in all of my projects there is an implementation of https://underscorejs.org/#sortBy

    The difference is that the callback maps the value to something that is already sortable using other native PHP functions, like an integer or a string. I find it way more intuitive than writing these function($a, $b) {/* try to remember which of [-1,0,1] it is supposed to return /} abominations. So as a solutions to remembering "which of [-1,0,1] should it be" I'd expect just natively implementing in C sane* sortBy function to replace this pre-historic PHP bullshit. But whatever, it's a matter of taste…

    …Or so I thought until now. Now that I think about it, I see [-1,0,1] callback as something really fucked up. PHP usort (and basically all PL ordering functions I know) can order only linear sequences, i.e. it returns an ordered list. Not even a lattice. Basically this means real numbers (or, more comfortable to use in a PL: strings). And with [-1,0,1] I can define whatever the fuck I want. There's nothing to stop me from implementing "paper/scissors/rock" (or even something much more convoluted) in it, and I have to idea how usort will behave then. That doesn't sound good.

    So I'd like somebody to persuade me that I personally need [-1,0,1] comparison model for some use case I apparently never encountered. The only reason I can think of why [-1,0,1] might be better is performance (or RAM, actually), but I don't accept is as a valid argument: somehow even my non-optimal sortBy PHP implementation always turns out to be enough, and if I really should worry about sorting performance, PHP probably isn't the right language for my use-case anyway.

  • Lenses and Partial-application - Going functional one step at a time
    2 projects | dev.to | 19 Mar 2022
    The code illustrated in this post is not recommended for use in production but the concepts most certainly are. Libraries like lodash and underscope provide many tried and tested, production-ready functions, some from the FP camp, that can simplify your code and make it easier to create reusable code.
  • A note from our sponsor - Klotho
    klo.dev | 31 Jan 2023
    Build cloud backends with Infrastructure-from-Code (IfC), a revolutionary technique for generating and updating cloud infrastructure. Try IfC with AWS and Klotho now (Now open-source) Learn more →


Basic underscore repo stats
2 months ago
Write Clean JavaScript Code. Always.
Sonar helps you commit clean code every time. With over 300 unique rules to find JavaScript bugs, code smells & vulnerabilities, Sonar finds the issues while you focus on the work.