Node.js で map() で Array 処理を行う方法のメモ。
■実行結果
const str_objs = [{str: 'abc'}, {str: 'def'}, {str: 'ghi'}]; const strs = str_objs.map((x) => { return x.str; }); console.log(strs);
■実行結果
[ 'abc', 'def', 'ghi' ]