Implement getType(value)
typeof famously can't tell an array from an object, and says typeof null === "object". Write getType(value) that returns a precise, lowercase type string:
getType(null); // "null"
getType([1, 2]); // "array"
getType(new Date()); // "date"
getType(/abc/); // "regexp"
getType("hi"); // "string"
getType(undefined); // "undefined"Hint: Object.prototype.toString.call(value) returns "[object Type]" for (almost) everything, that's the tool that makes this precise.