Last active
August 29, 2015 13:56
-
-
Save kazuki-aruga/9203918 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
// 文字列リテラルでプロパティ名を指定するとjsFiddleでインデントが崩れる | |
var obj = { | |
"foo": 1, | |
"bar": 2 | |
}; |
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
// プロパティ名を文字列リテラルで指定したときは、行末にコメントを付与すると正しくインデントされる | |
var obj = { | |
"foo": 1, // | |
"bar": 2 | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment