-
Notifications
You must be signed in to change notification settings - Fork 15k
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
In the lesson introducing functions and how they are called, the first example is:
function favoriteAnimal(animal) {
return animal + " is my favorite animal!";
}
console.log(favoriteAnimal('Goat'));
While this is technically correct, I think this example introduces too many concepts at once for learners who are just encountering functions. Specifically:
It uses a function inside another function call (console.log()
), which adds a layer of abstraction.
The explanation talks about
passing a function call as an argument in a different function call
– a phrasing that may be conceptually heavy for beginners.
Suggestion:
Instead, consider introducing function calls in isolation first. For example:
function favoriteAnimal(animal) {
return animal + " is my favorite animal!";
}
let message = favoriteAnimal('Goat');
console.log(message);
This keeps the focus squarely on:
- How a function is called.
- What it returns.
- How we can use that return value (via assignment).
Then, once the learner understands the basics of return values and variables, it’s a good time to introduce using a function call as an argument.
Path
Foundations
Lesson Url
https://www.theodinproject.com/lessons/foundations-function-basics
(Optional) Discord Name
ralphwiggum69
(Optional) Additional Comments
No response