main
Last change
on this file was d565449, checked in by stefan toskovski <stefantoska84@…>, 4 weeks ago |
Update repo after prototype presentation
|
-
Property mode
set to
100644
|
File size:
423 bytes
|
Rev | Line | |
---|
[d565449] | 1 | var keyList = Object.keys;
|
---|
| 2 |
|
---|
| 3 | exports.equal = function equal (a, b) {
|
---|
| 4 | if (a === b) return true;
|
---|
| 5 | if (!(a instanceof Object) || !(b instanceof Object)) return false;
|
---|
| 6 |
|
---|
| 7 | var keys = keyList(a);
|
---|
| 8 | var length = keys.length;
|
---|
| 9 |
|
---|
| 10 | for (var i = 0; i < length; i++)
|
---|
| 11 | if (!(keys[i] in b)) return false;
|
---|
| 12 |
|
---|
| 13 | for (var i = 0; i < length; i++)
|
---|
| 14 | if (a[keys[i]] !== b[keys[i]]) return false;
|
---|
| 15 |
|
---|
| 16 | return length === keyList(b).length;
|
---|
| 17 | };
|
---|
Note:
See
TracBrowser
for help on using the repository browser.