Answers for "Function example"

5

how to make a function

function myFunction(){
	console.log('hi')
}
myFunction()
Posted by: Guest on March-09-2020
3

function

function factorial(n) {
  if (n == 0) {
    return 1;
  } else {
    return factorial(n - 1) * n;
  }
}
Posted by: Guest on July-11-2021
7

function

funcion name_of_funtion(){

}
Posted by: Guest on May-04-2021
1

function

function linearSearch(value, list) {
    let found = false;
    let position = -1;
    let index = 0;
 
    while(!found && index < list.length) {
        if(list[index] == value) {
            found = true;
            position = index;
        } else {
            index += 1;
        }
    }
    return position;
}
Posted by: Guest on June-11-2020
0

basic function example

function myFunction(a, b) {

   return a * b;
}
Posted by: Guest on June-01-2021
0

Function example

// Define a function that prints a stringfunction welcomeMessage() {  console.log('Welcome to JavaScript');}// Call the functionwelcomeMessage();
Posted by: Guest on August-02-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language