Skip to content

Commit

Permalink
细节调整
Browse files Browse the repository at this point in the history
  • Loading branch information
huyaocode committed Sep 18, 2019
1 parent cec3cd9 commit 0055163
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 36 deletions.
26 changes: 0 additions & 26 deletions 算法/树的遍历/二分搜索树中求和.js

This file was deleted.

7 changes: 0 additions & 7 deletions 算法/树的遍历/克隆对象.js

This file was deleted.

2 changes: 1 addition & 1 deletion 编程题与分析题/compose.md
Expand Up @@ -14,7 +14,7 @@ function compose(funcs) {

for(let i = 0; i < len; i ++) {
if(typeof funcs[i] !== 'function') {
throw new TypeError('Expected a function');
throw new TypeError('Expected function');
}
}

Expand Down
5 changes: 3 additions & 2 deletions 编程题与分析题/深浅拷贝.md
Expand Up @@ -83,10 +83,11 @@ function deepClone(origin, target) {
// 如果是对象/数组,返回一个空的对象/数组,
// 都不是的话直接返回原对象
function getEmptyArrOrObj(item) {
if(Object.prototype.toString.call(item) === '[object Array]') {
let itemType = Object.prototype.toString.call(item)
if(itemType === '[object Array]') {
return []
}
if(Object.prototype.toString.call(item) === '[object Object]') {
if(itemType === '[object Object]') {
return {}
}
return item
Expand Down

0 comments on commit 0055163

Please sign in to comment.