Created
August 28, 2015 11:57
-
-
Save chuck0523/c24902a0682f09417813 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
// Generated by CoffeeScript 1.9.3 | |
/* | |
JSではこう書く | |
function hello() {} | |
var hello = function() {} | |
coffeeでは後者! | |
*/ | |
(function() { | |
var hello, helloDefault, helloName, helloReturn, msg; | |
hello = function() { | |
return console.log("hello"); | |
}; | |
hello = function() { | |
return console.log("hello"); | |
}; | |
hello(); | |
helloName = function(name) { | |
return console.log("hello " + name); | |
}; | |
helloName("chuck"); | |
helloDefault = function(name) { | |
if (name == null) { | |
name = "defo"; | |
} | |
return console.log("hello " + name); | |
}; | |
helloDefault(); | |
helloReturn = function() { | |
return "hello"; | |
}; | |
msg = helloReturn(); | |
console.log(msg); | |
/* | |
JSではこう書く | |
(function(){ | |
hoge | |
}) | |
*/ | |
(function() { | |
return console.log("hello"); | |
})(); | |
}).call(this); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment