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.
programming-examples/js/Vre2/Validate whether a given va...

11 lines
292 B
JavaScript

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));