This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var noMatch = /\w\b\w/; | |
var noMatch = /(.)^/; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 普通字面量对象的深拷贝 | |
_.cloneDeep = function (obj) { | |
if (typeof(obj) != 'object' || obj == null) return obj; | |
if(obj instanceof Date) { | |
return new Date(obj.getTime()); | |
} | |
var newObj = {}; | |
// 数组 | |
if(Object.prototype.toString.call(obj) === '[object Array]') { |
NewerOlder