This project is read-only.

Object.prototype.equalsByKey(obj, key)


Compare with a object and indicate whether they are the same.


  • obj: the object to be compared.
    • Type: Object
  • key: the key of object whose value is as the identity for the comparison.
    • Type: string

Returned Value:

  • Boolean value indicating whether they are the same.


var obj = { name: "Banana", weight: 50 };
document.write(obj.equalsByKey({ name: "Banana", weight: 55 }, "name"));
//Result: true;

Last edited Aug 22, 2012 at 9:47 AM by rynnwang, version 2


No comments yet.