News for hackers. Stuff that matters.
Re:Dynamic Languages Are Static Languages (2011) by jameshart on Wednesday July 22, 2015 @07:16PM (#9932998)
"Window.location returns a Location object" "you can also assign a DOMString to it" "The parseInt() function parses a string argument and returns an integer" "If string is not a string, then it is converted to one"

Seems like this documentation talks about little else than types to me?

Re:Dynamic Languages Are Static Languages (2011) by gorena on Thursday July 23, 2015 @09:04AM (#9935407)
> "The parseInt() function parses a string argument and returns an integer"

This seems... factually incorrect? Shouldn't it say "a double"? (or a "number", which just means "double" in JS)

It might ignore any characters after a ".", but it's impossible to return an integer in JS...

Re:Dynamic Languages Are Static Languages (2011) by chc on Thursday July 23, 2015 @03:22PM (#9937894)
No, it returns an integer. ECMAScript doesn't officially have a distinct integer type, but the number returned will still be an integer. Incidentally, most JavaScript implementations actually do have an internal integer representation, even though typeof will still just say it's a number.