Functions (Intro)

Let's invoke some functions! Complete the following tasks in your console.

A JavaScript function is a block of code designed to perform a particular task. A JavaScript function is executed when "something" invokes it (calls it). -W3Schools

  1. Invoke the Date() function to show today's date.
  2. Invoke the alert() function with a parameter - a string that will be your alert message.
  3. Invoke alert to view the function itself in console.
    • Hint: alert("This is an alert!");.
    • Hint: Removing the parenthesis returns the function's block of code, instead of invoking the function itself.
  4. Invoke the callThisFunction() function with a parameter - your name (i.e. "Derek").
    • Note: I added this function to the Document. alert() and Date() are global functions provided by JavaScript.