JavaScriptでmapを使うメモ

const postData = labels.map(function (x) {
    return {
        code: x.code.value,
        displayName: x.displayName.value
    }
})

こんなやり方でもok

const postData = labels.map(x => {
    return {
        code: x.code.value,
        displayName: x.displayName.value
    }
})

おすすめ記事
© 2016-2017 Fridles All Rights Reserved.