Using Functions
Why Use Functions?
Repeating the same code makes your programs long, harder to read, and difficult to update. Functions let you group commands into a reusable block, reducing repetition and keeping your code clean.
To call a function, write its name followed by parentheses. If the function requires arguments, place them inside the parentheses. For example:
greet("Alice")
Swipe to start coding
Solution
Explore other courses in Catalog
Thanks for your feedback!
ninja.js
Ask AI
Ask AI
Ask anything or try one of the suggested questions to begin our chat
Awesome!
Completion rate improved to 3.57
Using Functions
Swipe to show menu
Why Use Functions?
Repeating the same code makes your programs long, harder to read, and difficult to update. Functions let you group commands into a reusable block, reducing repetition and keeping your code clean.
To call a function, write its name followed by parentheses. If the function requires arguments, place them inside the parentheses. For example:
greet("Alice")
Swipe to start coding
Solution
Explore other courses in Catalog
Thanks for your feedback!
ninja.js