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

推荐订阅源

www.infosecurity-magazine.com
www.infosecurity-magazine.com
Vercel News
Vercel News
G
Google Developers Blog
MyScale Blog
MyScale Blog
The Register - Security
The Register - Security
I
InfoQ
Blog — PlanetScale
Blog — PlanetScale
D
DataBreaches.Net
Microsoft Security Blog
Microsoft Security Blog
V
Visual Studio Blog
V2EX - 技术
V2EX - 技术
F
Fortinet All Blogs
博客园_首页
S
Secure Thoughts
GbyAI
GbyAI
S
Security Affairs
N
News | PayPal Newsroom
Forbes - Security
Forbes - Security
Recent Announcements
Recent Announcements
H
Hackread – Cybersecurity News, Data Breaches, AI and More
Security Archives - TechRepublic
Security Archives - TechRepublic
宝玉的分享
宝玉的分享
Hugging Face - Blog
Hugging Face - Blog
Hacker News - Newest:
Hacker News - Newest: "LLM"
H
Heimdal Security Blog
A
About on SuperTechFans
P
Proofpoint News Feed
H
Help Net Security
Application and Cybersecurity Blog
Application and Cybersecurity Blog
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
Y
Y Combinator Blog
L
LINUX DO - 最新话题
Apple Machine Learning Research
Apple Machine Learning Research
L
LangChain Blog
博客园 - 叶小钗
A
Arctic Wolf
Cisco Talos Blog
Cisco Talos Blog
T
The Exploit Database - CXSecurity.com
人人都是产品经理
人人都是产品经理
T
Threat Research - Cisco Blogs
N
News and Events Feed by Topic
Security Latest
Security Latest
The Hacker News
The Hacker News
T
Tor Project blog
O
OpenAI News
博客园 - 三生石上(FineUI控件)
PCI Perspectives
PCI Perspectives
量子位
大猫的无限游戏
大猫的无限游戏
Stack Overflow Blog
Stack Overflow Blog

博客园 - 一丝心情

glb格式3d模型压缩 nuxt.js 项目流水线自动部署设置 免费的云数据库 vue 实用指令 IntelliJ IDEA license server 激活(亲测有效) win10/win11专业版激活码(亲测有效) npm 安装依赖报错整理 css3文字渐变, svg文字渐变 http/https与websocket的ws/wss的关系 指令 v-tooltip vue 自定义指令实现v-overflow-tooltip element-ui NavMenu 多级嵌套封装 常用css vue.config.js config.resolve.alias 目录别名配置 three.js 在低版本浏览报THREE.WebGLProgran: shader error 报错解决办法 nuxt 低版本浏览器兼容babel编译配置 常用软件历史版本下载 前端常用指令 vue 中 echarts 添加事件 常用正则
数组常用方法总结
一丝心情 · 2022-09-22 · via 博客园 - 一丝心情
  1.  判断数组中是否存在某个值

    var arrData = ['html', 'css', 'javascript'];
    var value = 'css';
    
    console.log(arrData.includes(value));
    console.log(arrData.some(item => item === value));
    console.log(arrData.indexOf(value) < 0 ? false : true);
    console.log(arrData.findIndex(item => item === value) < 0 ? false : true);
    console.log(arrData.find(item => item === value) !== undefined ? true : false );
    var arrData = [{ name: 'html' }, { name: 'css' }, { name: 'javascript' }];
    var value = 'css';
    
    console.log(arrData.some(item => item.name === value));
    console.log(arrData.filter(item=> item.name === value)[0] ? true : false);
    console.log(arrData.find(item => item.name === value) ? true : false);
  2.  数组去重

    var arrData = ['html', 'css', 'javascript', 'css'];
    
    console.log([...new Set(arrData)]);
    console.log(Array.from(new Set(arrData)));
    console.log(arrData.filter((item, index, slef) => slef.indexOf(item) === index));
    console.log(arrData.reduce((prev, cur) => prev.includes(cur) ? prev : [...prev, cur], []));