-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy path060-ObjectExtensions.js
More file actions
46 lines (40 loc) · 924 Bytes
/
060-ObjectExtensions.js
File metadata and controls
46 lines (40 loc) · 924 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
//console.debug("begin objectextensions.js");
//deep comparison of two objects
//if (typeof Object.equals == "undefined")
//Object.equals = function(a, b) {
// if (typeof a != typeof b)
// return false;
//
// if (a === b)
// return true;
//
// if (a instanceof RegExp)
// return a.toString() === b.toString();
//
// if (a instanceof Date)
// return Number(a) === Number(b);
//
// if (typeof a != 'object')
// return false;
//
// if (a.length !== undefined) {
// if (a.length !== b.length)
// return false;
// for (var i = 0, len = a.length; i < len; ++i)
// if (!equal(a[i], b[i]))
// return false;
// }
//
// for (var key in a) {
// if (!equal(a[key], b[key]))
// return false;
// }
//
// return true;
//}
//if (typeof Object.prototype.equals == "undefined")
//Object.prototype.equals = function(b) {
// return Object.equals(this, b);
//}
//console.debug("end objectextensions.js");