Determining whether there is an element in the array JQuery

$.inArray()

var array = ['a','ab','abc'];
$.inArray('abc',array);

Js This method is similar to the indexOf()method, if there is an element of the array, the index of the element is returned, if not, it returns -1

Published 79 original articles · won praise 89 · views 20000 +

Guess you like

Origin blog.csdn.net/qq_39141486/article/details/104083514