"1" + 2 === "12"
is not unique to JS (sans the requirement for the third equals sign), it’s a common feature of multiple strongly typed languages. imho it’s fine.
EDIT: I did some testing:
What it works in:
- JS
- TS
- Java
- C#
- C++
- Kotlin
- Groovy
- Scala
- PowerShell
What produces a number, instead of a string:
- PHP
- SQL
- Perl
- VB
- Lua
What it doesn’t work in:
- R
- C
- Go
- Swift
- Rust
- Python
- Pascal
- Ruby
- Objective C
- Julia
- Fortran
- Ada
- Dart
- D
- Elixir
And MATLAB appears to produce 51, wtf idk
Haha, most people here do tech it seems. Well, me too.
People seem to think I’d be good at maths and my entire job is like maths. I’m not and I don’t view it that way. There’s a lot of problem solving and engineering, but I find it very creative and expressive