JavaScript is determined whether there is an element in the array


indexOf()

var arr = ["a","b","c","d"]

The method is mainly determining the presence of the array element, if present, the element index is returned, does not exist -1

Here Insert Picture Description

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

Guess you like

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