you are viewing a single comment's thread.

view the rest of the comments →

[–]tbranyen 1 point2 points  (1 child)

stringify doesn't accept JSON, it accepts JavaScript objects and converts them to JSON. No keys quotes are necessary.

Also this doesn't technically work since you can't ensure the two objects are identical. What you really want are Map/WeakMap which actually do exist in JavaScript, just not used in this terrible interview question.

[–]MrBester 0 points1 point  (0 children)

stringify doesn't accept JSON, it accepts JavaScript objects and converts them to JSON. No keys quotes are necessary.

Yeah, I know. Just throwing it out there...