4 ms·
Yeah because we can't possibly have languages which diverge in syntax... I mean I don't use any languages every day where the concat operator is || for example
by Ulti 11y ago
Yeah because we can't possibly have languages which diverge in syntax... I mean I don't use any languages every day where the concat operator is || for example which is short circuit OR for most people. cough PgSQL cough
JavaScript overloading + to mean addition and string concatenation was the worst decision ever given the use case of JS. 1 + '1' * 1 is not the same as '1' + 1 * 1 good job. That definitely wont be evil once the values are in a more complex equation with variables coming from some server side JSON string... at all. Definitely wont lead to any unusual bugs when something like the following happens 1 + '000001'. You might not notice 2 being 12 for a while but your customer will likely notice 2 suddenly becoming 1000001.
At least '~' joins two different string together when writing. Makes a lot more sense than '+' to me ~ Ulti 2015