4 ms·
That's an overly broad generalization, and doesn't line up with my experience. For example I don't see much about "classes" in MDN: https://developer.mozilla.
by svachalek 11y ago
That's an overly broad generalization, and doesn't line up with my experience.
For example I don't see much about "classes" in MDN:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/parseInt https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...
https://developer.mozilla.org/en-US/docs/Web/API/Window/location https://developer.mozilla.org/en-US/docs/Web/API/Window/loca...
- jameshart 11y ago"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?
- gorena 11y ago> "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...
- chc 11y agoNo, 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.
- rhaps0dy 11y agostring: The value to parse. If string is not a string, then it is converted to one [...] radix: An integer between [...] The Window.location read-only property returns a Location object You gave supporting evidence for my point.
- barsonme 11y agoTake PHP or Python's standard library. Both are built around types, yet this is legal: $foo = "hello, world!"; $foo = 12; When you use a string-related function in Python, you expect the parameters to be strings, yet there's no type-safety enforced until runtime.
- dllthomas 11y agoThis is legal in Haskell: let foo = "hello, world" in let foo = 12 in foo Whether bindings can be shadowed has nothing to do with whether typing is static or dynamic.
- deleted 11y ago[deleted]