Is object primitive type - Node.js Object

Node.js examples for Object:Object Type

Description

Is object primitive type

Demo Code

function isPrimitive(arg) {
  return arg === null ||
         typeof arg === 'boolean' ||
         typeof arg === 'number' ||
         typeof arg === 'string' ||
         typeof arg === 'symbol' ||  // ES6 symbol
         typeof arg === 'undefined';
}

Related Tutorials