<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
<body>
<div id="app"> </div>
</body>
<script>
let arr = [1,3,55,8];
// 需求:arr数组中的所有小于5的值翻倍并求和
let count = arr.filter(function(n){
return n < 5;
}).map(function(n){
return n*2;
}).reduce(function(preValue, n){
return preValue + n;
},0);
console.log(`和:${count}`);
</script>
</html>

最新文章

  1. 【皇甫】☀Spring开题中...
  2. java中数组的相关知识
  3. caffe中各层的作用:
  4. objective-c中使用cocoa的NSPredicate,谓词(十四)
  5. Debian 8 编译安装nginx 1.8
  6. window下自己主动备份数据库成dmp格式的bat写法
  7. linux 自动备份脚本
  8. Cousera课程Learning How to Learn学习报告
  9. 关于理解python类的小题
  10. 使用CentOS Linux Bridge搭建Vxlan环境
  11. NVisionXR引擎基本介绍
  12. HQL: The Hibernate Query Language
  13. 计算机网络通信TCP/IP协议浅析 网络发展简介(二)
  14. 利用朴素贝叶斯分类算法对搜狐新闻进行分类(python)
  15. Javascript:自己写模板引擎
  16. 说明Heap与stack的差别。
  17. 基于Helm和Operator的K8S应用管理的分享
  18. django static 无法正确加载目录下的css
  19. [UE4]事件处理(Handling Events)和委托(Delegate)代码示例(二)【C++】
  20. mybash的编写与调试

热门文章

  1. .7、void*
  2. C#中System.ServiceProgress报错
  3. Java课后总结-原码、补码、反码
  4. codeforceCodeForces - 1107G
  5. Python安装1 —— Python3.8的安装
  6. wxPython学习笔记
  7. 从首个IMO季军谈起 作者 : 付云皓
  8. BZOJ1040: [ZJOI2008]骑士 树套环DP
  9. PTA 1001 A+B Format
  10. C语言 三目运算