Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

function

function doSomething()
{
   var x;

   x = 10;
   y = 20;

   alert('x = ' + x);
   alert('y = ' + y);
}
Comment

function

function factorial(n) {
  if (n == 0) {
    return 1;
  } else {
    return factorial(n - 1) * n;
  }
}
Comment

function

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'
Comment

function example

>>> def hello(name):
>>>     print('Hello {}'.format(name))
>>>
>>> hello('Alice')
>>> hello('Bob')
Hello Alice
Hello Bob
Comment

Define function

function say(message) {
    console.log(message);
}

let result = say('Hello');
console.log('Result:', result);
Code language: JavaScript (javascript)
Comment

function

#pip install danielutils
from danielutils import overload

class Foo:
    def __init__(self):
        pass
        
	#'None' to skip
    @overload(None, int)
    def __add__(self, other):
        return 1

    @overload(None, str)
    def __add__(self, other):
        return 2
      
@overlaod(str,[int,float])
def bar(name,age):
	return 3
  
@overload(str,str)
def bar(name,color):
	return 4
  
if __name__ == '__main__':
    print(Foo()+5) #-> 1
    print(Foo()+"s") #-> 2
	print(bar("jake",5)) #-> 3
    print(bar("jake",5.5)) #-> 3
    print(bar("jake","blue")) #-> 4
Comment

function

funcion name_of_funtion(){

}
Comment

function

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

/function

/function <name:unknown>
/function <name:string>
Comment

Function example

// Define a function that prints a stringfunction welcomeMessage() {  console.log('Welcome to JavaScript');}// Call the functionwelcomeMessage();
Comment

function

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.
Comment

function

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

function

// function declaration
void greet() {
    cout << "is it possible";
}
Comment

function


// function bilal(){
//     console.log("bilal joyia")
// }

// bilal();

// function future(){
//     console.log("developer")
// }
// future();
Comment

function

<type> function(parameter)
{
	do this;
    return value;
}

/*
int add(number1, number2)
{
	return number1 + number2;  
}
print(add(2,3));
*/
Comment

function

int main()
{
   foo();
   getchar();
   return 0;
}
void foo()
{
   printf("foo called");
}
Comment

PREVIOUS NEXT
Code Example
Javascript :: html table to csv javascript 
Javascript :: reactjs debounce 
Javascript :: what is lexical environment in javascript 
Javascript :: javascript regex zero or more occurrence 
Javascript :: scrollintoview 
Javascript :: alert modal 
Javascript :: null vs undefined 
Javascript :: js await 
Javascript :: for in and for of in js 
Javascript :: dependency list useeffect 
Javascript :: make indexOF in js 
Javascript :: javascript list comprehension 
Javascript :: copy an array 
Javascript :: using mongoose with node js 
Javascript :: react npm start not working 
Javascript :: javascript join 2 variables into string 
Javascript :: remove two things from javascript string 
Javascript :: last item of array js 
Javascript :: dom in javascript 
Javascript :: namespace javascript 
Javascript :: js modulo 
Javascript :: object destruction in javascript 
Javascript :: update column with find sequelize 
Javascript :: array of objects in javascript 
Javascript :: template literals js 
Javascript :: mongodb mongoose concatenate two values before get 
Javascript :: aria labelledby js 
Javascript :: jquery detach and remove 
Javascript :: flask server js return from folder 
Javascript :: angular append to FormControl errors 
ADD CONTENT
Topic
Content
Source link
Name
9+1 =