【JQuery】jQuery.inArray 确定第一个参数在数组中的位置

函数:jQuery.inArray(value,array,[fromIndex])

解释:

        value:用于在数组中查找是否存在

        array:待处理数组。

        fromIndex:用来搜索数组队列,默认值为0。

注意:区分参数类型

例子:
var m_31 = [1,3,5,7,8,10,12];
var m_30 = [4,6,9,11];
console.log(jQuery.inArray(3, m_31));

个人理解:

匹配获得的值是否在一个数组中,个人用在显示权限列表哪块[不应该写在前台啊],,,,,

参考:http://www.php100.com/manual/jquery/

        http://www.k68.org/?p=816

原文地址:https://www.cnblogs.com/oiliu/p/4666918.html