核心提示:含泪再来一篇面经编写函数,实现:inject(node1, node2, top); //node1作为node2内部顶部子节点插入 inject(node1, node2, bottom); //n...
含泪再来一篇面经…
inject(node1, node2, ‘top’); //node1作为node2内部顶部子节点插入 inject(node1, node2, ‘bottom’); //node1作为node2内部底部子节点插入 inject(node1, node2, ‘after’); //node1作为node2的下一个兄弟节点插入
function inject(node, target, direction){ }
已提供三个判断类型函数 isSimple、isArray、isPlainObject,编写函数实现深克隆。
function deepClone(obj){ }