Skip to content

Instantly share code, notes, and snippets.

Created April 18, 2017 07:25
Show Gist options
  • Save anonymous/bcc7af5a74c447823742c3f0fb3176a5 to your computer and use it in GitHub Desktop.
Save anonymous/bcc7af5a74c447823742c3f0fb3176a5 to your computer and use it in GitHub Desktop.
7.1 Counter created by smillaraaq - https://repl.it/HHjJ/1
var counter = 0;
function increment(num){
counter += num;
console.log("counter: " + counter);
}
increment(2); // counter is now 2
increment(6); // counter is now 8
increment(-1); // counter is now 7
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment