you are viewing a single comment's thread
view the rest of the comments
[–] 2 points 1 year ago (1 child)

Well it's what you'd want but not what it does, for one, but for another: comparing scalars is very easy, comparing complex structures is not. To compare one array with another you'd need to iterate over each element, recursively.

That JavaScript handles arrays as objects is also not bad, that's just a language feature that you may like or not, not much can go wrong there. The reassignment of "this" or how JS handlesnumber comparison, yeah, that is infuriatingly bad

  • source
  • parent
  • hideshow 1 child comment
  • [–] 1 point 1 year ago* (last edited 1 year ago)

    Yeah. JS is okay with lots of funny (and not fun) type coercions (toString on everything? really?), has no notion of reference as data type, but somehow automatic iteration on array by "==" operator is too much

    You are right, that's not want I would want from it, it is bad, I will never like that. And you are also right there are things even worse than this, no question there

    Edit: "implementing iteration on == would have been too much" is an invalid argument, if anyone had doubts

  • source
  • parent