Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
aj73975224yI swear the number of dependencies in JS projects is insane. Just with a little analytical thinking and problem solving, a typical JS developer would find a big difference in their source code.
-
zlot3454yhttps://github.com/jonschlinkert/...
I'm seriously considering creating "is-true" and "is-false" packages.
Moar starz for me -
crisz82364y@aj7397 Could you tell me an example of dependency like this? And why did you think exactly to lodash?
-
I wonder what it returns for isOdd(0) :)
how do you check whether 0 is odd or even with this lib? :) -
@netikras It looks like is-odd just returns false for 0. It just takes the absolute value, checks whether it's a valid integer, and returns (n % 2) === 1
-
Parzi88334yyou need a check that the var isn't 0 as well as that gives an even modulo in some langs.
-
@Parzi Javascript is one of those languages. As far as I can tell, isOdd(0) returns false and isEven(0) returns true.
-
-
i actually find this kinda interesting for other reasons. if we had a variable with a value "up to and including some arbitrarily large integer" n, then you could determine if that number is even or odd when adding it to another number, without necessarily knowing what the value of n is.
so for example if
your starting point m is even, then n's starting point MUST be odd, and vice versa.
and if the set count of integers on the numberline is even or odd than that tells us something.
for example if we start on m=4
then n0=5 and lets say its set length is 2. so n1=7.
we then need only m, n0, or set length, to determine the parity of n1.
im tired and i dont know why im typing this. -
@netikras would you explain to me why?
it seems that if numbers alternate between even and odd, and 1 is odd then that *should* imply what precedes it is even. but what you're saying is no?
why? -
@Wisecrack IDK, I was taught that in school :D
And the https://wikiwand.com/en/... article explains WHY I was taught that and why am I wrong...
Damn. You can't even trust your teachers :/
My appologies -
It is a mystical pull. When i was trying our Ramda in a react project for the first time i found myself compelled to get into currying and composition to eliminate even the simplest of transforms.
Related Rants
-
rephiscorth38Everyone here ranting about a fucking missing semicolon. I can't remember the last time a missing semicolon wa...
-
tahnik63So I need to create a nice new web app. Let's look at some cool JS frameworks that I can work with. *5 mins l...
-
ahmedam23What only relying on JavaScript for HTML form input validation looks like
Well it can happen!!!
joke/meme
lol
fuck
js
true story