Skip to content

Instantly share code, notes, and snippets.

@sumardi
Created January 3, 2014 18:33
Show Gist options
  • Save sumardi/8243547 to your computer and use it in GitHub Desktop.
Save sumardi/8243547 to your computer and use it in GitHub Desktop.
function warningMaker( obstacle , zones ){
var count = 0;
return function ( number, location ) {
count++;
zones.push(location);
alert("Beware! There have been " +
obstacle +
" sightings in the Cove today!\n" +
number +
" " +
obstacle +
"(s) spotted at the " +
location +
"!\n" +
"This is Alert #" +
count +
" today for " +
obstacle +
" danger.\n" +
"Current danger zones are:\n" +
function () {
for (var i = 0; i < zones.length; i++) {
return zones[i] + "\n";
}
}
);
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment