Skip to content

Instantly share code, notes, and snippets.

@chuck0523
Created August 28, 2015 11:57
Show Gist options
  • Save chuck0523/c24902a0682f09417813 to your computer and use it in GitHub Desktop.
Save chuck0523/c24902a0682f09417813 to your computer and use it in GitHub Desktop.
// 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