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
-
var
->let
/const
- concatenate -> template literal
-
==
->===
- anonymous function -> arrow function
- update an obsolete example (see the comment in the issue)
- simplify
cluster.workers
iteration:Object.keys().forEach
->for
...in