javascript - Is there a way to check if an array holds more than one value? -


for example, if needed code have set of numbers in array list happen? example array [1,3,4,5,9]. there way check , see if array contained these integers @ once , in same order?

var arraysearch = function (subarray,array ) {     var = -1;     return subarray.every(function (v) {             if(i != -1) {                 i++;                 return (array.indexof(v) === i)             }             = array.indexof(v);             return  >= 0;     }); };  var arr = [1,3,4,5,9];  console.log(arraysearch([4,5],arr)) 

Comments

Popular posts from this blog

Capture and play voice with Asterisk ARI -

c++ - Can not find the "fiostream.h" file -

java - Why database contraints in HSQLDB are only checked during a commit when using transactions in Hibernate? -