Lesson 5: tying it all together I'M STUCK HELP ME :D


hi guys,

this is the exercise:

// Nicely written function:
var calculate = function (number) {
var val = number * 10;

// Badly written function with syntax errors!

greeting var func{name}(console.log(name)))} ===> write this code nice is the exercise!

my answer:

var = greetings (name) {


i get an error


the name of the function, (greetings), needs to be on the left side of the equal sign, after var. You also need the word function before the parameter, name.


thank you for your answer, but I still don't get it..

Can you write the code, because I still get an error..


var greetings = function (name)


look at

the syntax of this code ^.

it goes

var functionName = function(parameters) {
    //inside of the function you indent and write 
    //what you want to do, such as 

That means you just need to replace the words functionName and parameters with greetings and name respectively.


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.