8

So typeof typeof undefined = "string"

Just great... JS ... Just great

Comments
  • 1
  • 3
    @12bitfloat another weird one is the fact that

    [1,3,11].map(parseInt) returns [1, NaN, 3]
  • 1
    @iambenkay JavaScript is a wonderful language ;)
  • 1
    Yeah. I love it more than anything
  • 1
  • 1
    Does typeof return the type in a String?
  • 10
    What's weird about that? typeof returns a string, which you then pass to typeof again. Nothing wrong here.
  • 17
    Dude. You should 1) look up the return type of "typeof" and 2) look up the arguments of parseInt. Right after you found out that map passes element, index, array, in that order, to its supplied callback. 3 is not a valid number in a base 1 system, whereas 11 is a completely valid 3 in a base 2 system.

    Of course rockets suck if you don't know how to fly them.
  • 1
    @jaza-k It was, JavaScript sucks lol
  • 5
    console.log("11"+1)
    111
    console.log("11"-1)
    10

    Well well well, what have we here? Operator underload?
  • 6
    I'm all for bashing JS but fuck, this is a stupid complaint.
  • 7
    Lets see what you are....
  • 1
    @nitwhiz I actually know all about this JSYK. was just notifying the general public
  • 1
    @nitwhiz Thank you for bringing some sense to this thread.
Add Comment