mh108
7/2/2019 - 4:54 PM

Demo functions.js file

// jshint esversion: 7

/* demo-functions.js
   This is an example of the format to use for a functions.js file.
   Note how each function declaration is labeled with a short comment
   describing the project requirement.
*/

//req. 2a
function square(n) {
  return Math.pow(n, 2);
}

//req. 2b
let square2 = function(n) {
  return Math.pow(n, 2);
};

//req 2c
let greetByfullName = function(fname, lname) {
  return `Greetings, ${fname} ${lname}!
  Welcome to Planet Earth!`;
};