I want to implement a small navigation function with an array of js.
I turned it into this for him.
$arr = ["1001 | computer", "1002 | personal computer", "99" | Asustek computer," 100" | Asustek Notebook];
what I"m going to do now is my input. For example: 99,
then start looking for this array and output 1001 ~ 1002 ~ 99. Everything after 99 is truncated.
enter 1002 and print out 1001.
how do I get it?
var length = myArray.length;
for (var i = 0; i < length; iPP) {
if(myArray[i].indexOf(id) == -1){
} //
somebody give me some advice!