| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
It also will be consistent with a previous code example.
There was a problem hiding this comment.
Can you use "started"? There is an online event, and this isn't it.
Sorry, something went wrong.
There was a problem hiding this comment.
Done.
Sorry, something went wrong.
There was a problem hiding this comment.
this is worse than original
Sorry, something went wrong.
There was a problem hiding this comment.
@sam-github Should I also change the prototype into the for...in variant?
Sorry, something went wrong.
There was a problem hiding this comment.
sure
Sorry, something went wrong.
There was a problem hiding this comment.
@sam-github Done.
Sorry, something went wrong.
`cluster.workers` iteration: `Object.keys().forEach` -> `for`...`in`
|
LGTM, should be squashed before landing. |
Sorry, something went wrong.
| } | ||
|
|
||
| Object.keys(cluster.workers).forEach((id) => { | ||
| for (const id in cluster.workers) { |
There was a problem hiding this comment.
Nit: I think it's better to keep Object.keys here? for...in also includes non own enumerable properties.
Sorry, something went wrong.
There was a problem hiding this comment.
Nvm for...in is also used below.
Sorry, something went wrong.
There was a problem hiding this comment.
There are no such properties in cluster.workers.
Sorry, something went wrong.
There was a problem hiding this comment.
Yes I know, but I think the intention is to also educate in examples?
Sorry, something went wrong.
There was a problem hiding this comment.
Yes, this example educates that there are no such properties, that cluster.workers is a vanilla js object underived from anything, and doesn't require complex boiler plate safe-guards to be used.
Sorry, something went wrong.
There was a problem hiding this comment.
Fair enough :)
Sorry, something went wrong.
|
ping @nodejs/documentation |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Checklist
Affected core subsystem(s)
doc, cluster
Description of change
Fixes: #10255