code: function elemObjEq(x, y) {
    return (Number.isNaN(x) && Number.isNaN(y)) || x === y;
  }
docs: Returns true if x === y or if x and y are both NaN.  This is meant for shallow equals over elements with "object" dtype only.