dojo.indexOf
The function can find out the position of a specific value in an array.
Try to find the value span>name
The address of the array:
var list=[“name”,”age”]
console.log(dojo.indexOf(list, " name"));
.
index What is returned is the subscript of the first position. Therefore, if there are multiple items in the array with the same value, it will only stop at the first item. Dojo provides a similar function, dojo.lastIndexOf
allows you to find the last position of a specific value. This function is the same as dojo.indexOf
runs in exactly the same way.