how to merge two arrays in javascript based on id