HHMM.prototype.eq(other: ): boolean
eq = equal
Given another time, check if this
and the input time represent the same time.
If you're using the HM symbol property, you most likely don't want to use this function. You will be dealing with plain strings, so just check whether one string equals the other string.
If you're working with HHMM objects, you must use this function
to compare equality of two HHMM objects. It's not possible to override
==
and ===
in javascript. If you compare with ===
, you end
up comparing object references, instead of the value they represent.
const time = new HHMM("20:00") time.eq(time) time.eq("24:00") time.eq(600) // comparing minutes. 600 minutes = 10:00