Attached: odd function.png (439x497, 19K)
Should checking if a variable is a number the responsibility of a function named isOdd?
Ayden Wright
Cameron Martinez
>safe integer
Is JavaScript memory unsafe?
Nathan Reed
>===
Disgusting.
Jacob Foster
require("is-even");
require("is-odd");
require("is-number");
require("is-variable");
require("is-object");
require("is-bytes");
require("is-silicon");
require("is-??????");
require("stop-using-javascript");
Jaxson Sanders
npm install numberchecker
Chase Lee
It can be if the interpreter is broken. Otherwise it is safe, but weak dynamic typing language is retarded anyway.
Aiden Ross
Ryan Parker
Yes, because it needs to know that before trying to figure out whether it's odd or not.
Julian Thomas
Should it be legal to put a licence on a function of a single line?
Samuel Mitchell
The license was probably added automatically.
Luis Hughes
"Safe" I assume means "exactly representable". Javascript doesn't actually have integers, only doubles. So if an integer result would be bigger than 2^53 or so, some of the lower bits get lost in the conversion to double.
Andrew Jones
I'm gonna throw up
Carter Moore
>abs() for seemingly no reason
>redundant type checks
>bitshift by zero for seemingly no reason
>double bitwise not in case it still isn't a number
>double logical not in case the actual parity check still isn't a boolean
>I'm still not sure if it's the right type. Let's use the identity operator to make it more safe
At least some of this retardation was changed along the way, but damn what an abomination.
Ayden Russell
I fixed it
Aaron Hill
Hi, it's me, Jon Schlinkert, programmer, public speaker and author of more than 1,100 code projects. I have published code projects in several different languages, but most are JavaScript. 90+ of my projects receive more than 10 million downloads/month, with the total exceeding 3.9 billion downloads/month.
Alexander Myers
kek
Jose Ramirez
will it cause a stack overflow?
Parker Wright
Let value = -2,147,483,648
n = math.abs(value)
n = 2,147,483,648
Value exceeds maximum safe interger
Work on your code user. Also what happens if you pass a non number to abs?
Ryder Scott
>you pass a non number
see 'expected a number' part
>exceeds maximum safe interger
see 'value exceeds maximum safe integer'
Carter Allen
Yes but -2,147,483,648is a safe interger so it should be processed as such and you are passing a number to abs before the if statements so if abs cant handle the exception youll have a problem and if it does handle it then the if is redundant.
Tyler Flores
>Cnile thinks javascript has actual integers
ecma-international.org
ecma-international.org
Xavier Price
>Cnile
lol
Hunter Cruz
newfag
Ian Cooper
Wtf why would you use thos garbage. Also ive never used C but any language ive seen has an int as 2^64
Brandon Robinson
>Javascript doesn't actually have integers, only doubles.
every time I learn something about this language I'm horrified in new and different ways