Skip to content

Instantly share code, notes, and snippets.

@agustinpfs
Last active July 7, 2020 17:33
Show Gist options
  • Save agustinpfs/32f16d6c368a608d82b7fe746dea1c51 to your computer and use it in GitHub Desktop.
Save agustinpfs/32f16d6c368a608d82b7fe746dea1c51 to your computer and use it in GitHub Desktop.

Revisions

  1. agustinpfs revised this gist Jul 7, 2020. 1 changed file with 9 additions and 0 deletions.
    9 changes: 9 additions & 0 deletions funcion-ej1.js
    Original file line number Diff line number Diff line change
    @@ -13,3 +13,12 @@ function myFuncion(a, b) {

    //invocación:
    myFuncion(3, 4); // 7

    // Podemos crear una función en la que no necesitamos que retorne un valor, sino, que ejecute un comportamiento:

    function myFuncion() {
    alert("Hola Mundo");
    }

    myFuncion(); //crea un alerta en el navegador

  2. agustinpfs created this gist Jul 7, 2020.
    15 changes: 15 additions & 0 deletions funcion-ej1.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,15 @@
    function myFuncion() {
    return 3 + 4; //sentencia. “return” me devuelve el valor calculado
    }

    //invocación:
    myFuncion(); // 7

    //Utilizando parámetros:

    function myFuncion(a, b) {
    return a + b;
    }

    //invocación:
    myFuncion(3, 4); // 7