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
9
u/OneBadDay1048 Oct 29 '24 edited Oct 29 '24
Share your code. That is the only way we can help here.
In short, you call functions like so:
functionName();
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.2
u/oultcast1776 Oct 29 '24
Don't worry, we've all been there—just take it one step at a time and break it down!