codingtcher.com
Theme Night
Home
Login

Javascript Functions

Home » Javascript » Js Functions

function in js

function myFunction(p1, p2) {
    return p1 * p2;  
//  The function returns the product of p1 and p2
}

js function

function MyFunction() {
	/* Function Here */
}

javascript function

function findMin(a, b, c) {
	if (a < b ) {
    	return a;
    } else {
    	return c;
    }
} else if (b < a) {
	if (b < c) {
    	return b;
    } else {
    	return c;
    }
} else {
	return c;
}
}

js function

function myfunction(p1,p2){
    return p1+p2 // للجمع بين القيمتان
}
var p = document.getElementById("tst");
p.innerHTML=myfunction(10,20) // النتيجة 30

javascript functions

function multiply(num1,num2) {
  let result = num1 * num2;
  return result;
}
Source: developer.mozilla.org

Function syntax Js

function funkyFunction(music, isWhiteBoy) {
  if (isWhiteBoy) {
    console.log('Play: ' +  music);
  }
}

JavaScript Function

function nameOfFunction () {
    // function body   
}

Javascript Related Post