return an array of strings from an array of objects js
var items = [{
id: 1,
name: 'AAA'
}, {
id: 2,
name: 'BBB'
}, {
id: 3,
name: 'CCC'
}];
var names = items.map(function(item) {
return item['name'];
});
console.log(names);
console.log(items);
Also in JavaScript:
- mapping a pojo with json via gson
- convert date format from yyyy-mm-dd to dd-mm-yyyy using value javascript
- javascript insertBefore
- js jquery class ending with string
- how do i pair of socks in an array javascript
- javascript truncate array
- jquery add element to array
- scroll to bottom of div javascript
- javascript get the last element of an array
- how to create multiple folders at once in node js
- jquery loop over elements
- should i put firebase in redux thunk
- localecompare javascript
- js create object url base64 pdf binary
- angular import service
- node js write file
- RFC8259 json
- how to use await to console
- jquery to hide a div
- javascript date difference in months
- javascript add day to date
- How to find the max id in an array of objects in JavaScript
- sending value in input angular material
- How can I upload files asynchronously