Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var array1 = ["test-123", "id-859","hi-8098", "hello-9090"];
- var array2= ["Welcome <span>test-123</span>", "Welcome33 <span>id-859</span>","How are you <span>hi-8098</span>", "Geat <span>hello-9090</span>", "see ya <span>nono-58758</span>"];
- var newArray= ["Welcome", "Welcome33 ","How are you ", "Geat "];
- newArray = array1.filter(e => array2.indexOf(e) !== -1); // in my case its undefined, as it does not recognize the html element in it.
Add Comment
Please, Sign In to add comment