Question 5


#1

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

// Badly written function with syntax errors!

var greeting =function(Name);{
function(number);
console.log("Hello"+""+Name);
greeting("Matthew");

ANY HELP!!


#2

var greeting =function(Name);{
//that semicolon is interfering with your function syntax, remove it

function(number); // you don't need this line at all

console.log("Hello"+""+Name);
//to encapsulate your function code, add a closing curly brace here

greeting("Matthew");
// this is how you call a function correctly :slight_smile:

Make the corrections and submit your code.


#3

Thanks very much!! Taking a while to get used to Javascript


#4

Same here, just keep at it :slight_smile:


#5

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