You can use the object's constructor property (which is usually inherited from its prototype) if the object in question has one (not all will; ones created via constructor functions usually will).
Example:
const dt = new Date();
console.log(dt.constructor === Date); // true
For instance, in ES2015+, Promise, Array, and others use constructor when creating new objects of the same type (for instance, Promise's then uses it, Array's slice uses it, etc.) so that those operations are friendly to subclasses. Gratuitous subclass example:
class MyArray extends Array {
}
const a = new MyArray("a", "b", "c");
const b = a.slice(1); // Creates new MyArray
console.log(b.join(", ")); // "b, c"
console.log(b instanceof MyArray); // true
In general, though, in JavaScript we tend to prefer duck typing to constructor or instanceof checks.