Week #3: Tutorials + JS Functions Problem Set + Blog Question.

Tutorials:

Problem Set:

Blog Question:

Describe the difference between declaring a function and calling a function. Give an example in a code snippet using Enlighter. Have your example use an argument.

A function is block of code designed to perform a specific task. This function is accomplished when something calls it. You use the keyword function followed by the function name to create a function declaration.

//Declaring a function
function blahBlah() {
      console.log("No worries, just declaring a function");
}

//Calling a function
blahBlah();
blahBlah();
blahBlah();

Join the Conversation

1 Comment

  1. I like how you used the increment value of i from the first loop in your second loop’s condition. Very clever.

    function climbingTheMountain(p) {
        for (let i = p.length; i > 0; i--) {
            let stair = p[i - 1];
            let spaces = "";
            for (let j = 0; j < i; j++) {
                spaces += " ";
            }
            console.log(spaces + stair);
        }
    }
Leave a comment

Your email address will not be published. Required fields are marked *

css.php