JAVASCRIPT   64

isObject

Guest on 1st May 2022 04:37:56 PM

  1. export default function isObject(input) {
  2.     // IE8 will treat undefined and null as object if it wasn't for
  3.     // input != null
  4.     return (
  5.         input != null &&
  6.         Object.prototype.toString.call(input) === '[object Object]'
  7.     );
  8. }

Raw Paste


Login or Register to edit or fork this paste. It's free.