Created
June 17, 2013 13:40
-
-
Save milkbread/5796944 to your computer and use it in GitHub Desktop.
JavaScript: JS-objects a simple example
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
| <script> | |
| var body = d3.select('body'); | |
| var an_object = {key1:"value1", key2:"value2"} | |
| body.append("text").text("1: ",an_object['key1']) | |
| body.append("text").text("2: ",an_object.key1) | |
| for (one_key in an_object){ | |
| body.append("text").text("3.1: ",one_key) | |
| body.append("text").text("3.1: ",an_object[one_key]) | |
| } | |
| </script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment