How to compare two javascript arrays and create two new arrays of missing and new elements? Array elements will be always strings or numbers and it is not 100% sure that they will be sorted in any way.
var array1= ['11', '13', '14', '18', '22', '23', '25'];
var array2= ['11', '13', '15', '16', '17', '23', '25', '31'];
var missing_elements = [];
var new_elements = [];
***Required Output:***
missing_elements= ['14', '18', '22']
new_elements= ['15', '16', '17', '31']