Guest User

Untitled

a guest
Jan 16th, 2019
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. var array1 = ["test-123", "id-859","hi-8098", "hello-9090"];
  2. 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>"];
  3.  
  4. var newArray= ["Welcome", "Welcome33 ","How are you ", "Geat "];
  5.  
  6. 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