JS clock - equals func fails