Skip to content

Instantly share code, notes, and snippets.

@DavidPeralvarez
Created March 26, 2020 12:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DavidPeralvarez/26bfd474506fdc08c3d98f936a1651d9 to your computer and use it in GitHub Desktop.
Save DavidPeralvarez/26bfd474506fdc08c3d98f936a1651d9 to your computer and use it in GitHub Desktop.
JavaScript - Parámetros: funciones
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Curso de Javascript</title>
</head>
<body>
<script src="scripts.js"></script>
</body>
</html>
/* Parámetros de las funciones */
function funcion1( fn ){
fn();
}
var funcion2 = function(){
console.log( 'Soy la función 2' );
};
funcion1( funcion2 );
funcion1( function(){
console.log( 'Soy la función anónima' );
} );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment