-
-
Save DavidPeralvarez/212c0149d3e9510210a04b2612167501 to your computer and use it in GitHub Desktop.
JavaScript - Parámetros: Objetos
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 mostrarDetallesPelicula( pelicula ){ | |
console.log( 'Título: ' + pelicula.titulo + ' | Dirección: ' + pelicula.direccion + ' | BSO: ' + pelicula.musica + ' | Puntuación: ' + pelicula.puntuacion ); | |
} | |
var pelicula = { | |
titulo: 'Interestelar', | |
direccion: 'Christopher Nolan', | |
musica: 'Hans Zimmer', | |
puntuacion: 9.5 | |
}; | |
mostrarDetallesPelicula( pelicula ); | |
mostrarDetallesPelicula( { | |
titulo: 'Batman: el caballero oscuro', | |
direccion: 'Christopher Nolan', | |
musica: 'Hans Zimmer', | |
puntuacion: 7.2 | |
} ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment