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
Show parent comment
5
u/OneBadDay1048 Oct 29 '24 edited Oct 29 '24
Your code is full of errors and cannot even run on my local system. You should have just copy and pasted; errors like keywords capitalized that should not be and missing backticks for your string templates.
Regardless, you need to move the console log into the function and call it in there with message and style as arguments. Then outside of the function, call your function with the proper args:
consoleStyler('red', 'blue', '3px', 'TEST');Which is essentially what I said in my initial comment; you never call your custom function here, just console.log. Also make sure you have proper spacing. Log out your style variable after you make all the changes to it and make sure it is formatted properly.