flat()方法可将多维数组展平为一维数组,而flatMap()方法在展平数组的同时还可以对每个元素执行映射操作。...const arr = [1, 2, [3, 4, [5, 6]]];// 使用 flat() 方法展平数组const flattened = arr.flat();console.log(flattened...); // [1, 2, 3, 4, [5, 6]]// 使用 flatMap() 方法展平数组并映射操作const mappedAndFlattened = arr.flatMap(num => num...* 2);console.log(mappedAndFlattened); // [2, 4, 6, 8, 10, 12]Object.fromEntries()这个静态方法允许将键值对列表转换为对象...const entries = [['name', 'John'], ['age', 30], ['city', 'New York']];// 将键值对列表转换为对象const obj = Object.fromEntries