Skip to content

Instantly share code, notes, and snippets.

View vicsarbu's full-sized avatar

Vic Sarbu vicsarbu

View GitHub Profile
/* 1. Write a function average that takes two numbers as input (parameters), and returns the average of those numbers. */
var average = function(x , y){
return (x+y)/2;
};
/* 2. Write a function greeter that takes a name as an argument and greets that name by returning something along the lines of "Hello, <name>!" */
var greeter = function(name){
return "Hello, " + name + "!";
/**
Pair Programming Practice. Submit a link to your gist here when you are done:
https://goo.gl/forms/mPumIHpIKF3W1gjt2
*/
/**
EXERCISE ONE
What is wrong with the following definitions of square? Write a sentence or two describing the issue(s); then,
try copying the erroneous examples into a console one-at-a-time and observing the error(s) generated (you may
have to attempt to invoke the functions to see the error). What errors are produced (if any) for each erroneous