ES6中Rest参数
发布日期:2021-05-14 14:31:40 浏览次数:16 分类:精选文章

本文共 1818 字,大约阅读时间需要 6 分钟。

���������������������������Rest���������������������������������������Rest���������Rest Parameters������ES6������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������

Rest���������������������������������������������������������������������������������������������������������������������������������������������������������Rest������������������������������������������

function emphasize(first, last, ...others) {
console.log('First:', first);
console.log('Last:', last);
console.log('Others:', others);
}

���������Rest������...others������������������������������������������������������������������others���������������������������������������������������������������������������������������������

���������������������Rest������������������������������������������������������������������������������������������������

function func(a, b, ...rest) {
// ������������
}

���������������Rest������������������������������������������������������������������������������������Rest������������������������������������������������������

���������Rest���������ES6������������������������������ES9���������������������������������������������������������������������������Rest������������������������������������������������������������

const config = {
key1: 1,
key2: 2,
key3: 3,
...rest
};

���������Rest������������������������������������������������������rest���������������������������������������������

���������������Rest������������������������������������������������������������������������������������������������������������������������������������������������Rest���������������������������������������������������������

上一篇:ES6扩展运算符,…的使用
下一篇:async,await的使用

发表评论

最新留言

网站不错 人气很旺了 加油
[***.192.178.218]2025年05月01日 10时20分18秒