Created
June 27, 2016 08:49
-
-
Save ksakae1216/ee14d63521307ac3c53332d519efb704 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
var myObj = new Object(), | |
str = "myString", | |
rand = Math.random(), | |
obj = new Object(); | |
myObj.type = "Dot syntax"; | |
myObj["date created"] = "String with space"; | |
myObj[str] = "String value"; | |
myObj[rand] = "Random Number"; | |
myObj[obj] = "Object"; | |
myObj[""] = "Even an empty string"; | |
console.log(myObj); | |
//表示結果 | |
Object { type: "Dot syntax", date created: "String with space", myString: "String value", 0.806938221617259: "Random Number", [object Object]: "Object", : "Even an empty string" } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment