function myFunction(){
console.log('hi')
}
myFunction()
function myFunction(a, b){
let calc = a + b;
return calc;
}
myFunction(5,3) // result= 8
>>> def hello(name):
>>> print('Hello {}'.format(name))
>>>
>>> hello('Alice')
>>> hello('Bob')
Hello Alice
Hello Bob
function say(message) {
console.log(message);
}
let result = say('Hello');
console.log('Result:', result);
Code language: JavaScript (javascript)
/function <name:unknown>
/function <name:string>
// Define a function that prints a stringfunction welcomeMessage() { console.log('Welcome to JavaScript');}// Call the functionwelcomeMessage();
variable = function_name ( args, ...);