文字列で判定します。
function isObject( obj ) {
return Object.prototype.toString.call( obj ) === "[object Object]"
}
isObject({}); // true
isObject([]); // false
Go to list of users who liked
More than 5 years have passed since last update.
文字列で判定します。
function isObject( obj ) {
return Object.prototype.toString.call( obj ) === "[object Object]"
}
isObject({}); // true
isObject([]); // false
Register as a new user and use Qiita more conveniently
Go to list of users who liked