I have noticed that you can compare dates like this in Javascript:
const a = new Date('2020')
const b = new Date('2019')
a > b // true
a >= b // true
a < b // false
But Date
is an object:
typeof a // object
How does this work? Can we do it for any class?