Created
May 21, 2012 02:35
-
-
Save jlengstorf/2760326 to your computer and use it in GitHub Desktop.
#5 Code example from "JSON: What It Is, How It Works, & How to Use It"
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 family = { | |
"jason" : { | |
"name" : "Jason Lengstorf", | |
"age" : "24", | |
"gender" : "male" | |
}, | |
"kyle" : { | |
"name" : "Kyle Lengstorf", | |
"age" : "21", | |
"gender" : "male" | |
} | |
} |
Same doubt...there should be a semicolon, isn't it..?
a semicolon is needed after curly brace on line 12.
Thanks for this helpful explanation
If you paste the code on http://jsonlint.com/ (without the var family =), he will give back an error with the semicolon at the line 12. Are we sure it is correct?
A semicolon after the curly brace on line 12 is optional: https://jsfiddle.net/0y36hbhg/
Just like a console.debug()
that's not ending with a semicolon but putting a semicolon after an executable line or block is highly recommended, it's proper coding practice.
How can I display all the data of objects inside this object in for-in loop to show in one page , like this example
https://gist.github.com/MohamDev/e064e49b10bd83d1af92
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hey Jason, just wondering, does the last close curly brace on line 12 need a semicolon after it? Thank you for the tutorial by the way, it's been very helpful and intuitive