//Create a function that displays "Hello, world!" In the console.
function helloWord() {
console.log('hello word');
}
//Create a function that receives a name as a parameter and displays "Hello, [name]!" In the console.
function checkName(name) {
console.log(hello, ${name}
);
}
checkName('Pedro');
// Create a function that receives a number as a parameter and returns double that number.
function calculateDouble(number) {
return number * 2;
}
console.log('Double is: ' + calculateDouble(5));
//Create a function that receives three numbers as parameters and returns their average.
function average(a,b,c) {
return (a + b + c) / 3;
}
console.log('The average is: ' + average(6, 4, 2));
//Create a function that receives two numbers as parameters and returns the largest of them.
function greaterNumber(A, B) {
return A > B ? A : B;
}
console.log('The greater number is:' + greaterNumber(15, 7));
//Create a function that receives a number as a parameter and returns the result of multiplying that number by itself
function multiply(number) {
return number * number;
}
console.log('The multiply is: ' + multiply(5));