Last active
December 31, 2015 22:39
-
-
Save paulodeleo/8054703 to your computer and use it in GitHub Desktop.
A simple and first comparision made between Coffeescript and Opal output in Javascript
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
Coffe: | |
http://coffeescript.org/#try:class%20User%0A%20%20constructor%3A%20(name)%20-%3E%0A%0A%20%20'admin%3F'%3A%20-%3E%0A%20%20%20%20%40name%20%3D%3D%20'Admin'%0A%0Auser%20%3D%20new%20User('Bob')%0Aalert%20user%0Aalert%20user.admin%3F | |
Opal: | |
http://opalrb.org/try/#code:class%20User%0A%20%20attr_accessor%20%3Aname%0A%0A%20%20def%20initialize(name)%0A%20%20%20%20%40name%20%3D%20name%0A%20%20end%0A%0A%20%20def%20admin%3F%0A%20%20%20%20%40name%20%3D%3D%20'Admin'%0A%20%20end%0Aend%0A%0Auser%20%3D%20User.new('Bob')%0Aalert%20user%0Aalert%20user.admin%3F |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment