Answers for "javascript function"

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
0

javascript function

function myFunction() {
  alert("Hello World!");
}
myFunction();
Posted by: Guest on March-15-2021
1

javascript function

the function of javascript is to teach first year programers 
synactically correct language constructs by way of an anti-pattern.
Posted by: Guest on April-14-2021
0

javascript function

<html>
   <head>  
      <script type = "text/javascript">
         function concatenate(first, last) {
            var full;
            full = first + last;
            return full;
         }
         function secondFunction() {
            var result;
            result = concatenate('Zara', 'Ali');
            document.write (result );
         }
      </script>      
   </head>
   
   <body>
      <p>Click the following button to call the function</p>      
      <form>
         <input type = "button" onclick = "secondFunction()" value = "Call Function">
      </form>      
      <p>Use different parameters inside the function and then try...</p>  
  </body>
</html>
Posted by: Guest on May-28-2021
0

javascript function

var x = myFunction(10, 10);     // 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 March-27-2021
0

javascript function

<div class="alert alert-warning alert-dismissible fade show" role="alert">
  <strong>Holy guacamole!</strong> You should check in on some of those fields below.
  <button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
</div>
Posted by: Guest on May-18-2021
0

javascript function

<!DOCTYPE html>
<html>
<body>

<h2>JavaScript Functions</h2>

<p>calculator function example</p>

<label>Result:</label>

<p id="fnc"></p>

<script>
function myFunction(p1, p2) {
  return p1 * p2;
}
document.getElementById("fnc").innerHTML = myFunction(2, 3);
</script>

</body>
</html>
Posted by: Guest on August-10-2021
0

javascript function

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 May-30-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language