Skip to content

Instantly share code, notes, and snippets.

@sirmxanot
Last active December 24, 2015 18:59
Show Gist options
  • Save sirmxanot/6847600 to your computer and use it in GitHub Desktop.
Save sirmxanot/6847600 to your computer and use it in GitHub Desktop.
# Ruby Code
def fun
a = 1
add1(a) == 2
sub2(a) == -1
end
def add1(num)
num += 1
end
def sub2(num)
num -= 2
end
// JavaScript Code
function Fun() {
this.a = 1;
}
Fun.prototype.add1 = function() {
this.a += 1;
}
Fun.prototype.sub2 = function() {
this.a -= 2;
}
new Fun().add1() === 2;
new Fun().sub2() === -1;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment