当前位置:网站首页>JS interview questions - arrow function, find and filter some and every
JS interview questions - arrow function, find and filter some and every
2022-06-11 11:24:00 【kilito_ 01】

find and filter The difference between
var a = [1,2,3,4,5,6,7]
a.find(item =>{ retuen item > 2})
find What will be returned is the specific value And only match the first result
a.filter(item =>{ retuen item > 2})
Will return all greater than 2 The data of
filter Will return a new array , The original array will not change It will filter out all qualified data
some and every The difference between
They all put back Boolean values
a.some(item =>{ retuen item > 2})
some Yes, as long as there is a value that meets the condition It will return true
a.every (item =>{ retuen item > 2})
every All values must meet the conditions Will return true
边栏推荐
- Summary of English thesis reading knowledge
- Vscode——vscode 多窗口名字配置成项目名字
- MySQL optimized learning diary 10 - locking mechanism
- An introduction to creating VOC datasets or Yolo datasets using labelimg
- Appearance mode -- it has been used in various packages for a long time!
- Planck plan 2022 Huawei software elite challenge is coming!
- js面试题---箭头函数,find和filter some和every
- 使用Yolov5训练自己制作的数据集,快速上手
- 发布WordPress数据库缓存插件:DB Cache Reloaded 3.1
- AcWing 1353. 滑雪场设计(贪心)
猜你喜欢

MSF CS OpenSSL traffic encryption

如何养成一个好习惯?靠毅力?靠决心?都不是!

Display of receiving address list 【 project mall 】

Interpretation of cube technology | past and present life of cube Rendering Design

Application of volatile in single chip microcomputer
![my.cnf中 [mysql]与[mysqld] 的区别 引起的binlog启动失败的问题](/img/bd/a28e74654c7821b3a9cd9260d2e399.png)
my.cnf中 [mysql]与[mysqld] 的区别 引起的binlog启动失败的问题

Introduction to database system -- Chapter 2 -- relational database (2.4 relational algebra)

Shi Yigong: I was not interested in research until I graduated from my doctor's degree! I'm confused about the future, and I don't know what to do in the future

企业微信小程序避坑指南,欢迎补充。。。

National multi-year solar radiation spatial distribution data 1981-2022, temperature distribution data, evapotranspiration data, evaporation data, rainfall distribution data, sunshine data, wind speed
随机推荐
NFT digital collection app system construction
NFT digital collection system platform construction
nft数字藏品系统开发搭建流程
WordPress数据库缓存插件:DB Cache Reloaded
設置默認收貨地址【項目 商城】
Jerry's acquisition of ble OTA dual backup upgrade (can only be used for chips above 4mbits) [article]
让WordPress支持注册用户上传自定义头像功能
Cube 技术解读 | Cube 渲染设计的前世今生
Development of official account system for digital collection app applet
数据库系统概论 ---- 第二章 -- 关系数据库(2.4 关系代数)
在毕设中学习02——numpy多维数组的切片,形态变化,维度交换
WordPress重新生成特色图像插件:Regenerate Thumbnails
202年最新热门收益较高的年金险产品是什么?
No category parents插件帮你去掉分类链接中的category前缀
JS prototype. The find () method has no effect on the object array. It is urgent...
Jerry's ble spp open pin_ Code function [chapter]
袋鼠云数栈基于CBO在Spark SQL优化上的探索
17.5 互斥量的概念、用法、死锁演示与解决详解
外观模式--在各种套餐中早就用到啦!
MSF CS OpenSSL traffic encryption