Sensible / unsurprising JavaScript type detection and comparison using a combination of ({}).toString and constructors.