惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

H
Heimdal Security Blog
C
Check Point Blog
Jina AI
Jina AI
T
Tailwind CSS Blog
IT之家
IT之家
Stack Overflow Blog
Stack Overflow Blog
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
人人都是产品经理
人人都是产品经理
S
SegmentFault 最新的问题
U
Unit 42
Cyberwarzone
Cyberwarzone
T
The Blog of Author Tim Ferriss
I
Intezer
V
Visual Studio Blog
月光博客
月光博客
A
Arctic Wolf
L
LINUX DO - 热门话题
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
T
Threatpost
F
Fortinet All Blogs
Simon Willison's Weblog
Simon Willison's Weblog
酷 壳 – CoolShell
酷 壳 – CoolShell
K
Kaspersky official blog
L
Lohrmann on Cybersecurity
T
Tenable Blog
爱范儿
爱范儿
大猫的无限游戏
大猫的无限游戏
博客园_首页
Recent Announcements
Recent Announcements
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
C
Cybersecurity and Infrastructure Security Agency CISA
P
Privacy International News Feed
The Register - Security
The Register - Security
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
J
Java Code Geeks
I
InfoQ
Application and Cybersecurity Blog
Application and Cybersecurity Blog
Webroot Blog
Webroot Blog
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
The Last Watchdog
The Last Watchdog
AWS News Blog
AWS News Blog
Last Week in AI
Last Week in AI
Spread Privacy
Spread Privacy
云风的 BLOG
云风的 BLOG
D
Darknet – Hacking Tools, Hacker News & Cyber Security
Apple Machine Learning Research
Apple Machine Learning Research
F
Full Disclosure
Vercel News
Vercel News
The Hacker News
The Hacker News

博客园 - 上官帅帅

vue3 - 01 路由的配置和使用 vue 环境配置 vue html DOM树对象 idea maven pom配置文件 .net core dapper (5) .net core dapper (4) .net core dapper (3) .net core dapper (2) .net core dapper (1) c# 异步 async await jq_js window 使用vagrant搭建开发开发环境 判断元素的属性是否存在 redis 基础知识 jQuey知识点三 解析json数据 mysql 基础操作一 ruby 基础知识三 读写文件 Active Record 数据迁移
js 查找树节点 数组去重
上官帅帅 · 2016-05-09 · via 博客园 - 上官帅帅

//查找树节点
function findData(curOrg, id) { var array = []; if ((typeof curOrg == 'object') && (curOrg.constructor == Object.prototype.constructor)) { array.push(curOrg); } else array = curOrg; for (var i = 0; i < array.length; i++) { var jn = array[i]; if (jn.OrgId == id) { return jn; } if (jn.Orgs != "") { return findData(jn.Orgs, id); } } }

以下方法来自: http://www.cnblogs.com/sosoft/archive/2013/12/08/3463830.html

//数组去重
   function unique(arr) {
     var result = [], hash = {};
     for (var i = 0, elem; (elem = arr[i]) != null; i++) {
       if (!hash[elem]) {
         result.push(elem);
         hash[elem] = true;
        }
      }
     return result;
    }