Created
January 18, 2019 05:56
-
-
Save shiro01/49113a946ddf42df93ac26746d4fa3fd to your computer and use it in GitHub Desktop.
javascript memo
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// https://developer.mozilla.org/ja/docs/Web/JavaScript/Reference/Global_Objects/Array/reduce | |
// https://qiita.com/rana_kualu/items/59832607ae407c467baa | |
// | |
const array1 = [{"a":1, "b":2, "d":4},{"a":1, "b":2, "c":4}]; | |
const reducer = (accumulator, currentValue) => JSON.stringify(accumulator) + '\n' + JSON.stringify(currentValue); | |
re = array1.reduce(reducer) | |
console.log(re); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment