PravoslavniyTypeof

 avatar
user_8809051
javascript
7 months ago
466 B
9
Indexable
Never
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;
}
Leave a Comment