You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
11 lines
292 B
JavaScript
11 lines
292 B
JavaScript
5 years ago
|
function is_object(value)
|
||
|
{
|
||
|
var datatype = typeof value;
|
||
|
return datatype === 'function' || datatype === 'object' && !!value;
|
||
|
}
|
||
|
|
||
|
console.log(is_object({name: 'Robert'}));
|
||
|
|
||
|
console.log(is_object('bar'));
|
||
|
|
||
|
console.log(is_object(72));
|