Last active
December 24, 2015 18:59
-
-
Save sirmxanot/6847600 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
# 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