标签:object == audio nbsp cti turn code 实现 eof
1 function deepEqual(x, y) { 2 if (x === y) { 3 return true; 4 } else if ((typeof x == "object" && x != null) && (typeof y == "object" && y != null)) { 5 if (Object.keys(x).length != Object.keys(y).length) 6 return false; 7 8 for (var prop in x) { 9 if (y.hasOwnProperty(prop)) { 10 if (!deepEqual(x[prop], y[prop])) 11 return false; 12 } 13 else 14 return false; 15 } 16 17 return true; 18 } 19 else 20 return false; 21 }
1 function shallowEqual(x, y) { 2 if (x === y) { 3 return true; 4 } else if ((typeof x == "object" && x != null) && (typeof y == "object" && y != null)) { 5 if (Object.keys(x).length != Object.keys(y).length) 6 return false; 7 8 for (var prop in x) { 9 if (y.hasOwnProperty(prop)) { 10 if ((x[prop] !== y[prop])) 11 return false; 12 } 13 else 14 return false; 15 } 16 17 return true; 18 } 19 else 20 return false; 21 }
js deepEqual & shallowEqual 小算法实现
标签:object == audio nbsp cti turn code 实现 eof
原文地址:https://www.cnblogs.com/ajaxkong/p/12009209.html