javascript - match an item in an array instead of doing a for loop -
here code
for(y=0;y<json.parse(sessionstorage.getitem("url")).length;y++){ if(json.parse(sessionstorage.getitem("url"))[y] != olistitem.get_item('privacystatementurls').get_url()){ listurl.push(olistitem.get_item('privacystatementurls').get_url()); } }
it goes through array see if there match item in list. there inbuilt function in javascript can use match if identical. he
match he
not hel hell hello
etc
Comments
Post a Comment