code: function equal(a,b) {
      if(a instanceof Array) {
          if(!(b instanceof Array))
              return false
          if(a.length !== b.length) {
              return false
          } else {
              for(var n=0; n<a.length; n++) {
                  if(!equal(a[n],b[n])) {
                      return false
                  }
              }
              // else
              return true
          }
      } else if(a instanceof Object) {
          if(!(b instanceof Object))
              return false
  
          var aKeys = Object.keys(a)
          var bKeys = Object.keys(b)
  
          if(aKeys.length !== bKeys.length) {
              return false
          } else {
              for(var n=0; n<aKeys.length; n++) {
                  var key = aKeys[n]
                  var aVal = a[key]
                  var bVal = b[key]
  
                  if(!equal(aVal,bVal)) {
                      return false
                  }
              }
              // else
              return true
          }
      } else {
          return a===b || Number.isNaN(a) && Number.isNaN(b)
      }
  }
docs: compares arrays and objects for value equality (all elements and members must match)