Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const array = [
- {id: '12727ssksks2', index: 0, item: '120dd2020'},
- {id: '12727dhdhdhd2', index: 2, item: '120dd2020'},
- {id: '1272ssmmss72', index: 1, item: '120dd2020'}
- ]
- let a=new Array(5).fill(null)
- array.forEach(i=>a[i.index]=i)
Add Comment
Please, Sign In to add comment