Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
#5 Code example from "JSON: What It Is, How It Works, & How to Use It"
var family = {
"jason" : {
"name" : "Jason Lengstorf",
"age" : "24",
"gender" : "male"
},
"kyle" : {
"name" : "Kyle Lengstorf",
"age" : "21",
"gender" : "male"
}
}

mkim17 commented Jun 18, 2015

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

Same doubt...there should be a semicolon, isn't it..?

zia-ict commented Jun 26, 2015

a semicolon is needed after curly brace on line 12.

Thanks for this helpful explanation

Lc0rE commented Jul 30, 2015

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?

5ervant commented Aug 7, 2015

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