Created
June 28, 2014 12:44
-
-
Save youcune/46158e88a03c62abb132 to your computer and use it in GitHub Desktop.
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
function myFunc(){ | |
alert('HELLO'); | |
} | |
myFunc(); | |
// ↓ 同じ動きをする | |
var myFunc = function(){ | |
alert('HELLO'); | |
} | |
myFunc(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
myFunc();
function myFunc(){
alert('HELLO');
}
// ↓ 同じ動かない。↑動くよね?ま、上みたいな書き方は分かりにくいから、やらないか。。
myFunc();
var myFunc = function(){
alert('HELLO');
}