Skip to content

Instantly share code, notes, and snippets.

@harryadel
Created August 28, 2016 12:13
Show Gist options
  • Save harryadel/37829af90aab86dbd47c68ea9f4e2d34 to your computer and use it in GitHub Desktop.
Save harryadel/37829af90aab86dbd47c68ea9f4e2d34 to your computer and use it in GitHub Desktop.

Revisions

  1. Hadouken created this gist Aug 28, 2016.
    14 changes: 14 additions & 0 deletions Deep comparsion
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,14 @@
    /*
    My answer for exercise 'Deep comparison'
    in Eloquent JavaScript Second Edition
    Chapter 4 Data Structures: Objects and Arrays
    */

    function deepEqual(o1, o2) {
    if(JSON.stringify(o1) === JSON.stringify(o2)) {

    return true;
    } else {
    return false;
    }
    }