DEV Community

Discussion on: JavaScript Quiz

Collapse
 
itsasine profile image
ItsASine (Kayla)

Right answers

Oh, yeah, I know my weird Javascript math 🎉

1 and 2 I know because of work since null and undefined can be a pain when testing.

3 is string concatination with 2 being made a string to make it magically work.

4 is making the string a number to make the math operator magically work.

5 is similar to 3 in that it's concatinating an (empty) string with a number that magically becomes a string.

6 is fun because + is the shorthand for type converting to an int.