Answers for "function js"

13

function javascript

var x = myFunction(4, 3);     // Function is called, return value will end up in x

function myFunction(a, b) {
    return a * b;             // Function returns the product of a and b
}
Posted by: Guest on September-05-2020
3

javascript function

function myFunc(theObject) {
  theObject.make = 'Toyota';
}

var mycar = {make: 'Honda', model: 'Accord', year: 1998};
var x, y;

x = mycar.make; // x gets the value "Honda"

myFunc(mycar);
y = mycar.make; // y gets the value "Toyota"
                // (the make property was changed by the function)
Posted by: Guest on October-15-2020
4

javascript function

// variable:
var num1;
var num2;
// function:
function newFunction(num1, num2){
	return num1 * num2;
}
Posted by: Guest on November-03-2020
1

javascript function

function myFunction(){
  document.write("Hello World!")
}
myFunction();
Posted by: Guest on September-02-2021
1

function js

function myFunc(param) {
  return param
}
console.log(myFunc("Hello World"))
Posted by: Guest on November-30-2020
-1

function js

function toCelsius(fahrenheit) {
  return (5/9) * (fahrenheit-32);
}
Posted by: Guest on December-18-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language