os-js / osjs-server

OS.js Server Module
https://manual.os-js.org
Other
19 stars 21 forks source link

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

Open andersevenrud opened 4 years ago

andersevenrud commented 4 years ago

Example:

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

// Vs
Object.fromEntries(Object.keys(obj)
  .map(key => ([key, obj[key])))
andersevenrud commented 4 years ago

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