-
Notifications
You must be signed in to change notification settings - Fork 15.5k
Open
Description
Checks
- This is not a duplicate of an existing issue (please have a look through our open issues list to make sure)
- I have thoroughly read and understand The Odin Project Contributing Guide
- Would you like to work on this issue?
Describe your suggestion
The factory function lesson is a great lesson but understandably tricky given the wealth of info to be taught.
Recently I've noticed a few questions where confusion stems from not quite following or even missing some comments, or otherwise questions about why the lesson's code style differs from other lessons (in case that is a signficant factor).
I think the following tweaks can help streamline the lesson a little:
- Reposition some comments to be above the code they directly refer to rather than below
- Split some code blocks so that some "bare" comments become normal lesson text, aiding in visibility and separating examples addressing separate concepts/steps.
- Adjust code style to be a little more consistent with previous lessons (e.g. using a function declaration for constructor rather than traditional func exp assigned to variable).
- Expand very slightly on opening paragraph for the section on IIFEs to help answer the question "well why can't we just write a normal factory function then call it once instead of wrapping it in an IIFE?"
Path
Ruby / Rails, Node / JS
Lesson Url
https://www.theodinproject.com/lessons/node-path-javascript-factory-functions-and-the-module-pattern
(Optional) Discord Name
No response
(Optional) Additional Comments
No response
Metadata
Metadata
Assignees
Labels
No labels