Skip to content

doc: modernize code examples in the cluster.md

Checklist
  • documentation is changed or added
  • commit message follows commit guidelines
Affected core subsystem(s)

doc, cluster

Description of change
  1. var -> let / const
  2. concatenate -> template literal
  3. == -> ===
  4. anonymous function -> arrow function
  5. update an obsolete example (see the comment in the issue)
  6. simplify cluster.workers iteration: Object.keys().forEach -> for...in

Fixes: https://github.com/nodejs/node/issues/10255

Merge request reports

Loading