Javascript object can't be comparable