check javascript object not array and not null

Solutions on MaxInterview for check javascript object not array and not null by the best coders in the world

showing results for - "check javascript object not array and not null"
Frida
05 Jul 2019
1In javascript an array is also an object, 
2so most of the time you want to exclude the array: 
3
4function isObjectExcludeArray(obj){
5	return (obj === Object(obj) && Object.prototype.toString.call(obj) !== '[object Array]');
6}
Monica
20 Sep 2019
1function isObject(val) {
2    if (val === null) { return false;}
3    return ( (typeof val === 'function') || (typeof val === 'object') );
4}
5
Vanessa
03 Feb 2020
1function isObject (item) {
2  return (typeof item === "object" && !Array.isArray(item) && item !== null && item!==undefined);
3}
4