Many people including myself have been having a problem with an exercise in Codecademy called, “One more function” in the section of “The Method” within the module of “FizzBuzz++: Return of the Modulus” – There is a simple trick which can make this process go much faster.
The trick is to use multiple browsers. I use Firefox as my primary browser and I was getting this strange error on several of the “Projects.” The error said something like “SandBox error” or “Sandboss is undefined” or something to that sort. I’ve found that switching between Internet Explorer and Safari browser can help with that strange error.
If you need help with 1.7 here’s my answer to the first half, and then I borrowed the code from another dude who made a phenomenal ternary code for the final segment.
Here’s some code which gives a successful “Next Exercise” operation:
//begin code
var comedy = {
schadenfreude: function() {
userResponse = prompt(“How was your day?”);
autoResponse = (“Oh, well it’s a good thing that “) + userResponse + (” happened. Let me make cakes made out of ice cream.”);
return autoResponse;
},
irony: function() {
userResponse = prompt(“Do you like to be a hero?”);
autoResponse = (“Your path will cause you to eat cheese.”);
return autoResponse;
},
// comment code – deletable
// begin code from the dude who I borrowed from
// note how excellent his ternary operator/statements are
// I love how he used the || to make the “or” side perfect
// end comment code
slapstick: function(n) {
return(n == “Murdoch” || n == “Gates”) ? “Pie!”:(n == “Hollande”) ? “Flour”: “Make Up!”; }
};
console.log(comedy.slapstick(“dig”));
//end