@jalcine @bram am I right in thinking this is because it attempts to convert both to strings before squishing them together?

@hugo @jalcine @bram yes, that is exactly what it does. The + operator doesn't exist for arrays, and it can't convert to numbers, so they're converted to strings and then "added".

@DarkCoinCoin ouais c'est le même genre de blague avec du type-operator-wise :/

@bram Because you should read the doc / the spec.

add operator is for add numbers and concat string. if any other type is involved in operation, they'll cast in another type supporting add operator.

@Purexo it's more like the design sucks, saying "the doc say that" is not a justification for bad design

@oliviamaia I just don't get how it can be a good OO design frankly

@bram I understand what's happening

I just think it's horrible

@enki same, I don't get that design, it's like perl type wise operators

Sign in to participate in the conversation

This is a mastodon instance for social justice activists, LGBTQIA+ people, and activists in general See the Goals and technical details, and Rules and privacy policy pages for more information