結果 : how to flatten an array of objects in javascript