PravoslavniyTypeof
user_8809051
javascript
2 years ago
466 B
11
Indexable
function typeOf(value){ if (typeof value === "object"){ if (value === null) return "null" if (value instanceof Date) return "date"; if (value instanceof Array) return "array"; if (value instanceof Number) return "number"; if (value instanceof Boolean) return "boolean"; if (value instanceof String) return "string"; if (value instanceof Array) return "array"; } if (typeof value === "function") return "function"; return typeof value; }
Editor is loading...
Leave a Comment