You can provide a fallback value of an empty object when destructuring to NPM: npm@next-7 and npm@6 and npm@7.3.0. for loop is more efficient than forEach, but we still use the latter unless we need every ounce of performence.