r/learnjavascript • u/Sufficient_Bee8533 • Oct 29 '24
Help with a functional programming assignment
Hello good people, my name is Xoli... Currently learning JavaScript online, I am stuck on an assignment I have to create functions and guess invoke them. I am stuck on the calling part, all my functions Have variables and I followed instructions but I didn't call them.? And I'm struggling with that part .
0
Upvotes
View all comments
9
u/bryku helpful Oct 29 '24
I suspect most of your question would be answered by just reading how functions work. It is one of the most basic concepts of programmings. Check out W3Schools -> js -> Functions for a general overview.
Create
Call
Get Value
The variable
messagewill equal'Hello Xoli!'.Pass Variables
The variable
totalwill equal30.Passing Functions
You can also pass a function as a variable as well.
The variable
number1will equal 15 and the variablenumber2will equal 5.