码迷,mamicode.com
首页 > 其他好文 > 详细

11111

时间:2017-12-27 23:55:11      阅读:395      评论:0      收藏:0      [点我收藏+]

标签:span   技术   values   turn   art   move   copy   nts   cheng   

argument

https://www.cnblogs.com/codepen2010/p/6824934.html

http://www.zhimengzhe.com/Javascriptjiaocheng/124065.html

 

14.Seek and Destroy 

金克斯的迫击炮!

实现一个摧毁(destroyer)函数,第一个参数是待摧毁的数组,其余的参数是待摧毁的值。

技术分享图片
function destroyer(arr) {
 // Remove all the values
 var tempArguments = arguments;
 return arr.filter(function(entry) {
  for(var i = 1; i< tempArguments.length; i++) {
   if (entry == tempArguments[i]) {
    return false;
   }
  }
  return true;
 });
}

destroyer([1, 2, 3, 1, 2, 3], 2, 3);

11111

标签:span   技术   values   turn   art   move   copy   nts   cheng   

原文地址:https://www.cnblogs.com/chenxuyangbk/p/8127912.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!