iOS技术校招开启啦!所有内推简历享绿色通道, 优先筛选、优先发放offer, 快人一步拿offer !
内部推荐
https://gw-c.nowcoder.com/api/sparta/jump/link?link=https%3A%2F%2Fneitui-h5.zhiyinlou.com%2Fshare_position%2F510391620%3F_dt_no_comment%3D1%26code%3Dc737e93a27ebe7e567a3f10100cb9c5d
全部评论
相关推荐
查看10道真题和解析 点赞 评论 收藏
分享
球球与墩墩:这不是前端常考的对象扁平化吗,面试官像是前端出来的
const flattern = (obj) => {
const res = {};
const dfs = (curr, path) => {
if(typeof curr === 'object' && curr !== null) {
const isArray = Array.isArray(curr);
for(let key in curr) {
const newPath = path ? isArray ? `${path}[${key}]` : `${path}.${key}` : key;
dfs(curr[key], newPath);
}
} else {
res[path] = curr
}
}
dfs(obj);
return res;
}
查看3道真题和解析 点赞 评论 收藏
分享