const obj = []; let r = 0;
if (typeof obj === "object" && obj !== null) r++;
if (obj instanceof Object) r++;