Created
January 3, 2014 18:33
-
-
Save sumardi/8243547 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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