Created
December 10, 2013 22:08
-
-
Save jlfwong/7901153 to your computer and use it in GitHub Desktop.
Automatic Semicolon Insertion - Scala vs JavaScript
This file contains hidden or 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 foo = function() { console.log("foo"); }; | |
var bar = function() { console.log("bar"); }; | |
(foo()) | |
(bar()) | |
/* | |
Ouput: | |
(bar()) | |
^ | |
TypeError: undefined is not a function | |
at Object.<anonymous> (/private/tmp/foo.js:5:1) | |
at Module._compile (module.js:456:26) | |
at Object.Module._extensions..js (module.js:474:10) | |
at Module.load (module.js:356:32) | |
at Function.Module._load (module.js:312:12) | |
at Function.Module.runMain (module.js:497:10) | |
at startup (node.js:119:16) | |
at node.js:901:3 | |
*/ |
This file contains hidden or 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
def foo() { println("foo") } | |
def bar() { println("bar") } | |
(foo()) | |
(bar()) | |
/* | |
Output: | |
foobar | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment