Skip to content

Instantly share code, notes, and snippets.

@MedinaGitHub
Created September 1, 2017 12:58
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 MedinaGitHub/36495af99cf8a582829db54e309b160d to your computer and use it in GitHub Desktop.
Save MedinaGitHub/36495af99cf8a582829db54e309b160d to your computer and use it in GitHub Desktop.
//Parametros REST
function agregar_alumnos(arr_alumnos, ...alumnos) {
for (alum of alumnos) {
arr_alumnos.push(alum);
}
return arr_alumnos;
}
let arr_alumnos = ["Sebastian"];
let result = agregar_alumnos(arr_alumnos, "scarlet", "seba jr", "scarlet jr");
console.log(result);// Resultado = ["Sebastian", "scarlet", "seba jr", "scarlet jr"].
//El Operador "Spread"
let numeros = [1, 3, 6, 8, 98, 46];
let max = Math.max(...numeros); //esto sin los ... no serviria.
console.log(max); // Resultado = 98
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment