Created
August 31, 2015 18:45
-
-
Save awonak/5c8a11adcd924793cbd5 to your computer and use it in GitHub Desktop.
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
var task_counter = 0; | |
task = function() { | |
return { | |
add: function(numberToAdd) { | |
if (numberToAdd < 10) { | |
task_counter = task_counter + numberToAdd; | |
} | |
else { | |
console.log('You cannot add a number greater than 10'); | |
} | |
}, | |
remove: function(numerToRemove) { | |
if (numerToRemove > 10) { | |
task_counter = task_counter - numerToRemove; | |
} | |
else { | |
console.log('You cannot add a number greater than 10'); | |
} | |
}, | |
show: function() { | |
return task_counter; | |
} | |
} | |
} |
grantelope
commented
Aug 31, 2015
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment