`); const checkedInstanceOfDate = iWindow.date instanceof Date; const checkedPrototypeOfDate = Date.prototype.isPrototypeOf(iWindow.date); const checkedSolutionFromSO = isValidDate(iWindow.date); console.log(`x instanceof Date ⇒ ${checkedInstanceOfDate}`); console.log(`Date.prototype.isPrototypeOf(x) ⇒ ${checkedPrototypeOfDate}`); console.log(`Object.prototype.toString.call(x) === '[object Date]' ⇒ ${checkedSolutionFromSO}`); function isValidDate(date) { return date && Object.prototype.toString.call(date) === "[object Date]" && !isNaN(date); }