So this proposal would require adding one more data type in the form of complex numbers.

`i`

without any further qualifiers couldn't be used as it would be a breaking change. But you could use something similar to BigInt and use the i as a postfix, so have `1i`

instead.

Let's see what this datatype would need to look like:

It would have 2 internal components, the real and the imaginary part both of which would be floating point numbers.

Arithmetic operations between a (real) number and a complex number should always yield a complex number, this would probably be done by implicitly converting real numbers into complex numbers with 0i as their imaginary component.

I think artihmetic operations between complex numbers should be self explaintory addition and subtraction being component wise and multiplication and division being a bit more complicated. (interesting case would probably be the modulo operator though)

Truthiness would probably be given if any of the components isn't 0.

I don't think Math.sqrt should yield a complex number for real number values, this could cause issues. If you want to get complex numbers you could instead force the conversion to a complex number by adding `+0i`

to the input.

Some interesting things to consider would be interaction with the trigonometric functions.

`a++`

should only increase the real value, as it does already. it should always be equivalent to `a = a + 1`

. I don't see a reason for having a separate imaginary number type either.

As for naming the type I'd probably call it `complex`

so `typeof 1i`

should yield `complex`

. `""+(0+0i)`

should yield `0+0i`

with neither the real component nor the imaginary component being omitted regardless of the value.

Some other thing that should probably be considered is how to get the separate componets for the number to handle them individually where required.