Varieties of varying variants of verifiable variables. . . Verily

Since this is my first entry I shall keep this short. This is a story of functions and those that speak of them.

Functions are ways of creating a repeatable effect; something we might call upon later. They take an argument, a parameter, a placeholder and create a beautiful effect by passing them into some sort of procedure to be used later.

You see functions by themselves are but lonely souls that sit there inanimate until they are called by their friends. You see the functions actually don’t realize they are being called unless the right number of arguments are presented.

In the following code segments there is a function created(createFullName). That function takes in two parameters, arguments, or variables if you will and returns a result to be used later. The var myFullName then calls the function into life by passing the parameters nam1 and nam2 into the function.

function createFullName(firstName, lastName){
 return firstName + “ “ + lastName;
var nam1 = “Chuck”;
var nam2 = “Norris”;
var myFullName = createFullName(nam1, nam2);

Now any bit of code attached to this can call the function into being and breathe new life into it, as seen below:

function eatFood(firstName, food){
 return firstName + “ likes to eat “ + food +”.”;
food = “whatever he chooses”;

console.log(eatFood(myFullName, food))

Good Night and may you dodge Chuck’s hidden fist.

Like what you read? Give Sean Salter a round of applause.

From a quick cheer to a standing ovation, clap to show how much you enjoyed this story.