随笔分类 -  判断元素在数组中

摘要:// 方法1:Array.prototype.contains = function (obj) { var i = this.length; while (i--) { if (this[i] obj) { return true; } } return false;};使用:arr.contai 阅读全文

posted @ 2016-10-10 15:13 武奘 阅读(177) 评论(0) 推荐(0) |

博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3