摘要:
<!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 阅读全文
摘要:
<!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 阅读全文
摘要:
一组数据,过滤出小于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) = 阅读全文
摘要:
<script> let buf = [10, 110, 20, 120, 30, 130]; // value记录上次结果 let mapBuf = buf.reduce(function(value, n) { console.log(value, n); return 100 + n; }, 阅读全文
摘要:
<script> let buf = [10, 110, 20, 120, 30, 130]; let mapBuf = buf.map(function(n) { return n * 2; }) console.log(mapBuf); </script> 阅读全文
摘要:
<script> let buf = [10, 110, 20, 120, 30, 130]; let filterBuf = buf.filter(function(n) { // 返回bool return n > 100; }) console.log(filterBuf); </script 阅读全文