Last active
March 19, 2018 21:22
-
-
Save Smithx10/a1073432bcf0cd573c662a60d05b9ca0 to your computer and use it in GitHub Desktop.
error handling
This file contains 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
5 recipes.prototype.getRecipe·=·function·getRecipe(name)·{§ | |
6 ····if·(typeof this.recipe[name]·!==·'undefined')·{§ | |
7 ········return·this.recipe[name];§ | |
8 ····}§ | |
9 ····else·{§ | |
10 ········return·name·+·'·not_found';§ | |
11 ····};§ | |
12 }§ | |
I'd like for this to still work. | |
recipes.prototype.createRecipe = function createRecipe(name, size) { | |
if(!this.getRecipe(name)) { | |
// do work | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment