动态参数

<script>
	function info(v1,...data){
        console.log(v1,data);
    }
	  info(11);
    info(11,22);
    info(11,22,333,444,55);
</script>
<script>
	function info(v1,v2,v3,v4){
        console.log(v1,v2,v3,v4);
    }

    info(11,22,333,444);
    nums = [22,33,44,55,66,77,88];
    info(11,...nums)
</script>

本文作者:Sherwin

本文链接:https://www.cnblogs.com/sherwin1995/p/16889580.html

版权声明:本作品采用知识共享署名-非商业性使用-禁止演绎 2.5 中国大陆许可协议进行许可。

posted @   Sherwin_szw  阅读(8)  评论(0编辑  收藏  举报
点击右上角即可分享
微信分享提示
💬
评论
📌
收藏
💗
关注
👍
推荐
🚀
回顶
收起
  1. 1 404 not found REOL
404 not found - REOL
00:00 / 00:00
An audio error has occurred.