Introduction to functions


#1

Please, i have difficulties with my syntax
// This is what a function looks like:

var divideByThree = function (300) {
var val = 300 / 3;
console.log(val);
};

// On line 12, we call the function by name
// Here, it is called 'dividebythree'
// We tell the computer what the number input is (i.e. 6)
// The computer then runs the code inside the function!
divideByThree(12);

i did this but sill they are saying still there is a problem with your syntax


2. js - introduction functions
#2

A function parameter cannot be a number alone,

change the 300 above to a letter or word,

and here, remove this variable

use a return statement and divide your named parmeter by 3,

return named_param / 3


#3

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