osjs-server icon indicating copy to clipboard operation
osjs-server copied to clipboard

Replace Object.keys + Array.reduce with Object.fromEntries

Open andersevenrud opened this issue 5 years ago • 1 comments

Example:

// This
Object.keys(obj)
  .reduce((current, accumulator) => ({...accumulator, [current]: obj[current]}), {});

// Vs
Object.fromEntries(Object.keys(obj)
  .map(key => ([key, obj[key])))

andersevenrud avatar Apr 14 '20 22:04 andersevenrud

Since Node 10 is not out of LTS This goes on the backburner.

andersevenrud avatar Apr 14 '20 22:04 andersevenrud