摘要:
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <script src="https://cdn.jsdelivr.net/npm/vue@2/dist/vue.js"></script> </head> <body> <div id="ap 阅读全文
posted @ 2021-07-05 15:08
thomas_blog
阅读(86)
评论(0)
推荐(0)
摘要:
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <script src="https://cdn.jsdelivr.net/npm/vue@2/dist/vue.js"></script> </head> <body> <div id="ap 阅读全文
posted @ 2021-07-05 14:58
thomas_blog
阅读(34)
评论(0)
推荐(0)
摘要:
一组数据,过滤出小于100的数,结果乘以2,并将结果汇总 <script> let buf = [10, 110, 20, 120, 30, 130]; let resBuf = buf.filter(n => n < 100).map(n => n * 2).reduce((value, n) = 阅读全文
posted @ 2021-07-05 14:36
thomas_blog
阅读(59)
评论(0)
推荐(0)
摘要:
<script> let buf = [10, 110, 20, 120, 30, 130]; // value记录上次结果 let mapBuf = buf.reduce(function(value, n) { console.log(value, n); return 100 + n; }, 阅读全文
posted @ 2021-07-05 14:24
thomas_blog
阅读(36)
评论(0)
推荐(0)
摘要:
<script> let buf = [10, 110, 20, 120, 30, 130]; let mapBuf = buf.map(function(n) { return n * 2; }) console.log(mapBuf); </script> 阅读全文
posted @ 2021-07-05 14:07
thomas_blog
阅读(70)
评论(0)
推荐(0)
摘要:
<script> let buf = [10, 110, 20, 120, 30, 130]; let filterBuf = buf.filter(function(n) { // 返回bool return n > 100; }) console.log(filterBuf); </script 阅读全文
posted @ 2021-07-05 13:58
thomas_blog
阅读(64)
评论(0)
推荐(0)