Skip to content

Instantly share code, notes, and snippets.

@shiro01
Created January 18, 2019 05:56
Show Gist options
  • Save shiro01/49113a946ddf42df93ac26746d4fa3fd to your computer and use it in GitHub Desktop.
Save shiro01/49113a946ddf42df93ac26746d4fa3fd to your computer and use it in GitHub Desktop.
javascript memo
// 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