-
-
Save DavidPeralvarez/8454cc5bedad37ac7c9fd09bf1666257 to your computer and use it in GitHub Desktop.
JavaScript - Parámetros de una función
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>Curso de Javascript</title> | |
</head> | |
<body> | |
<script src="scripts.js"></script> | |
</body> | |
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Parámetros de las funciones */ | |
function sumar( a, b ){ | |
console.log( a, b ); | |
return a + b; | |
} | |
function restar( a, b ){ | |
return a - b; | |
} | |
var num1 = 5, | |
num2 = 10, | |
resultado = sumar( num1, num2 ), | |
resultado2 = restar( num2, num1 ), | |
resultado3 = sumar( num1 ), | |
resultado4 = restar( 15, 7 ); | |
// console.log( resultado ); | |
// console.log( resultado2 ); | |
// console.log( resultado3 ); | |
console.log( resultado4 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment