Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // На входе массив
- const arr = [
- {name: 'width', value: 10},
- {name: 'height', value: 20}
- ];
- // На выходе объект {width: 10, height: 20}
- const a = {}
- arr.forEach(el => {
- a[el.name] = el.value;
- })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement