gets tokenized as 12. toString ( ), which is errant. This is not just an issue with the toString function, but rather with every member of numbers. (JavaScript only has two numeric types, and "integer" is not one of them.)
You can prove this by writing:
which gets tokenized as 12 . toString ( ), and thus returns 12, an integer, as a string.
gets tokenized as
12.toString(), which is errant. This is not just an issue with thetoStringfunction, but rather with every member of numbers. (JavaScript only has two numeric types, and "integer" is not one of them.)You can prove this by writing:
which gets tokenized as
12.toString(), and thus returns12, an integer, as a string.