Created
May 1, 2014 19:09
-
-
Save kiliankoe/9dc5a1a00356eebab264 to your computer and use it in GitHub Desktop.
Javascript Roadtrip 3 - 2.11
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
===== Mine ===== | |
"Incorrect Submission | |
Check out your syntax for semicolon, parentheses, or bracket issues." | |
function warningMaker( obstacle ){ | |
var count = 0; | |
var zones = []; | |
return function ( number, location ) { | |
count++; | |
zones.push(location); | |
var zonemessage = ""; | |
for (var i = 0; i < zones.length; i++){ | |
zonemessage = zonemessage + "\n" + zones[i]; | |
} | |
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.\nCurrent danger zones are:"+zonemessage | |
); | |
}; | |
} | |
===== Yours ===== | |
function warningMaker( obstacle ){ | |
var count = 0; | |
var zones = []; | |
return function ( number, location ) { | |
count++; | |
zones.push(location); | |
var list = ""; | |
for(var i = 0; i<zones.length; i++){ | |
list = list + "\n" + zones[i]; | |
} | |
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:" + | |
list | |
); | |
}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment