Compares JavaScript objects