“FONCTION” Réponses codées

fonction

function delay(time) {
  return new Promise(resolve => setTimeout(resolve, time));
}

delay(1000).then(() => console.log('ran after 1 second1 passed'));
Powerful Puma

fonction

function world(params){
 	//Code to be executed when the function is called. 
}
world()

//Explaination
//'world' in the function is the name of the function.
//There are brackets after function name. Those are use to push parameters
//The forth line Calls the function named 'world'
Ved

fonction

function functionName(parameter1, parameter2, parameter3) {
  body code goes here
}
sanderson

fonction

A function is a set of statements that take inputs, do some specific 
computation and produces output.

The idea is to put some commonly or repeatedly done task together and make a 
function so that instead of writing the same code again and again for different
inputs, we can call the function.
Heckar

FONCTION

[PHP]

<?php
function helloWorld() {
   echo "Hello World";
}

helloWorld();
?>

[Python]

def helloWorld():
  print("Hello World")
  
helloWorld()

[JavaScript / JS Normal Function]

function helloWorld() {
  console.log("Hello World!");
}

helloWorld()

[JavaScript / JS Dynamic, Arrow Function]

const helloWorld = () => {
   console.log("Hello World!");
}

helloWorld()
Talented Toucan

fonction

function nama_function(parameter/argument 1, parameter/argument 2, ...) {
  [Isi dari function berupa tindakan/steatment]
  return [expression];
}
Haris Munandar

Réponses similaires à “FONCTION”

Parcourir les réponses de code populaires par langue

Parcourir d'autres langages de code