当前位置:网站首页>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
边栏推荐
- MySQL optimized learning diary 10 - locking mechanism
- WordPress site link modification plug-in: Velvet Blues update URLs
- 如何养成一个好习惯?靠毅力?靠决心?都不是!
- 装饰模式--小美的生日蛋糕
- MWC 2022 lights up the future, and everything serves
- my. Binlog startup failure caused by the difference between [mysql] and [mysqld] in CNF
- 袋鼠云数栈基于CBO在Spark SQL优化上的探索
- Jerry's acquisition of ble OTA dual backup upgrade (can only be used for chips above 4mbits) [article]
- Jerry's acquisition of ble to check the causes of abnormal conditions such as abnormal code reset [chapter]
- No category parents插件帮你去掉分类链接中的category前缀
猜你喜欢

Enterprise wechat applet pit avoidance guide, welcome to add...
![Set the default receiving address [project mall]](/img/eb/2864b124b66d01849315a367948ed4.png)
Set the default receiving address [project mall]

VOC格式数据集转yolo格式数据集的方法

使用Yolov3训练自己制作数据集,快速上手

使用Yolov5训练好模型调用电脑自带摄像头时出现问题:TypeError: argument of type “int‘ is not iterable的解决方法

使用Yolov5训练自己制作的数据集,快速上手

Only when you find your own advantages can you work tirelessly and get twice the result with half the effort!

Characteristics and classification of creation mode (single case, factory)

使用pydub修改wav文件的比特率,报错:C:\ProgramData\Anaconda3\lib\site-packages\pydub\utils.py:170: RuntimeWarning:

Introduction to database system -- Chapter 2 -- relational database (2.4 relational algebra)
随机推荐
WordPress user name modification plug-in: username changer
Node连接MySql数据库写模糊查询接口
启牛帮开通的证券账户是安全可信的吗?
No category parents插件帮你去掉分类链接中的category前缀
Jerry's blepr0 and PR1 are used as ordinary IO ports [chapter]
Using domestic MCU (national technology n32g031f8s7) to realize pwm+dma control ws2812
Jerry's acquisition of ble distinguishes between reset and wake-up [chapter]
装饰模式--小美的生日蛋糕
Jerry's ble spp open pin_ Code function [chapter]
Processing of uci-har datasets
Lifeifei: I am more like a scientist in physics than an engineer
数字藏品系统app源码
想做钢铁侠?听说很多大佬都是用它入门的
js面试题---箭头函数,find和filter some和every
Don't be a fake worker
Liufan, CFO of papaya mobile, unleashes women's innovative power in the digital age
测试cos-html-cache静态缓存插件
Summary of information of main account of Chia Tai futures on Wednesday in advance
小白在同花顺上直接开户是安全的吗?
AI security and Privacy Forum issue 11 - stable learning: finding common ground between causal reasoning and machine learning