Skip to content

Instantly share code, notes, and snippets.

@bashbaugh
Last active February 24, 2019 04:44
Show Gist options
  • Select an option

  • Save bashbaugh/b991a6504fad0fa7428dfef266067607 to your computer and use it in GitHub Desktop.

Select an option

Save bashbaugh/b991a6504fad0fa7428dfef266067607 to your computer and use it in GitHub Desktop.
// Remember, this is a comment because it is after two slashes.
// The web browser ignores comments - they are just for the humans.
function print_full_name(first_name, last_name) // Here we declare the function name and arguments
{ // <-- This starts the function
console.log("Here is a full name:"); // This line is run first when the function is called
// And then this line is run,
// which pieces together the first_name argument, a space, and the last_name argument to create a full name:
console.log(first_name + " " + last_name); // Which gets printed to the console.
} // <-- And then this tells the browser that the function is finished.
// Keep in mind that JavaScript doesn't really care about whitespace (spaces, tabs, and new lines)
// so you could put all this (EXCLUDING COMMENTS) on one line and it wouldn't change anything.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment