Including bigint example in value type determination
mkermani144 opened this issue · comments
I already searched for this issue.
Edition: 2nd
Book Title: Get started
Chapter: 2
Section Title: Value Type Determination
Question: As you have mentioned about bigint
s in the chapter, shouldn't you include an example for bigint
s, indicating that typeof
returns "bigint"
(and not "number"
) for bigint
s? that is,
typeof 42; // "number"
typeof 42n; // "bigint" <-----------------
typeof "abc"; // "string"
typeof true; // "boolean"
typeof undefined; // "undefined"
typeof null; // "object" -- oops, bug!
typeof { "a": 1 }; // "object"
typeof [1,2,3]; // "object"
typeof function hello(){}; // "function"
Appreciate bringing the issue up. I agree that it would have been a good idea for me to include that line in the book.
But since this book was published 2.5 years ago (with many thousands of copies sold since), I don't see this change as important enough to warrant a deviation of the github content away from the printed book content.