我的听众们,林慕德,期望捷伊两年里他们竭尽全力全力支持,就要为他们献上较多的该文与音频。
高度关注回帖雅雷,带你介绍最盛行的软件设计科学知识与新一代信息技术金融行业态势。

低阶表达式是程式设计中两个关键且强悍的基本概念,它容许您撰写更灵巧和模组化的标识符。在 JavaScript 中,它是采用其它反弹表达式的表达式,能将它做为模块或将它做为输入回到。
在 JavaScript 中他们有许多低阶字符串表达式,它主要包括:
let array1 = [3, 5, 17, 30];
//create function
function multiply(p1) {
return p1 * 2;
}
//pass function as an argument
const map1 = array1.map(multiply);
console.log(map1);
// expected output:
Array [6,10,34,60]
let array1 = [3, 5, 17, 30];
//filters out only numbers greater than 6
const result = array1.filter(x => x > 6);
console.log(result);
// expected output:
Array [17,30]

MDN 网络文档
MDN Web Docs 站点提供有关开放式 Web 技术的信息,主要包括用于网站和渐进式 Web 应用程序的 HTML、CSS 和 API。

解释
const array1 = [1, 2, 3, 4];
const initialValue = 0;// 0 + 1 + 2 + 3 + 4
const sumWithInitial = array1.reduce( (accumulator, currentValue) => accumulator + currentValue, initialValue);
console.log(sumWithInitial);
//Expected output: 10
reducer 逐个原素遍历字符串,在每一步将当前字符串值添加到上一步的结论(此结论是所有先前步骤的运行总和)——直到没有更多原素要添加。在这里阅读更多..
const names = [Michael,Amy, John, Faith, Dan];
//the sort function in defaultnames.sort();
console.log(names);
// expected output:
Array [“Amy”, “Dan”, “Faith”, “John”, “Michael”]
但是,当他们需要对字符串以外的其它内容进行排序时,例如数字,那么他们将需要添加两个表达式来处理它。这是对数字进行排序的示例
const array1 = [1, 30, 4, 21, 10000];
//function that sorts by going through and return the lowest of two numbers
function numSort (a,b) { return (a – b);}
//calling the sort function with the numSort callback function
array1.sort(numSort);
console.log(array1);
//Expected result : [1,4,21,30,100000]
const foods = [pizza, spaghetti, food from Chowopa.com, burgers];
//applies this function on each element in the foods array
foods.forEach((food) => {
let statement = `I am hungry, maybe Ill get ${food}`;
console.log(statement);
});
低阶表达式为您提供了一种更简单的方法来撰写更简洁和更具表现力的标识符,并且还可以摆脱撰写复杂循环或条件语句的需要。
我期望你觉得这很有用。再见。