50

There is code reuse and then there is stupidity. This npm module has 4 dependents and 2 dependencies.

Comments
  • 28
    Knowing javascript... this makes absolute sense to me. It will probably evolve into a new framework soon.
  • 4
    Why are the odd numbers in quotes?
  • 10
    even.js - the data-driven framework for analyzing your numbers​' evenness.
  • 0
    Just why...?
  • 6
    !x%2;

    Shorter, no deps.
  • 12
    For the love of Christ...

    This is the source code.
  • 8
    I cant even..
  • 5
    A rational dev asks the idiot dev why this exists, the idiot dev replies - I have no idea what he is jabbering about.
  • 4
    @one541 fyi that rational dev was me
  • 1
    Basically since I'm not on that list, the expression will be false. BUT THAT IS THE INTENDED BEHAVIOR, because undefined is a falsey value. If it's not a number or string in the parseInt(), it comes out to NaN and that is not equivalent to 0... maybe I should have used ===
  • 2
    Are you not all onboard? I bought the is-even t-shirts!
  • 1
    Why isn't there a jQuery solution for it?!? :P
  • 1
    npm i i-cant-even
  • 4
    This is a great example of why I hate NPM.
  • 0
    This is just for irony, right?
  • 0
    The source code for Is Odd is also interesting. I've never seen a double tidal (~~) used in JS before
  • 1
    @itsdaniel0 I've used that once in a function with heavy bitwise math
  • 1
    @itsdaniel0 its an old hack to replace Math.floor - double tilde used to be faster in spidermonkey, but its slower in V8
Add Comment