Your first sample is not json
{
foo: true,
bar: 1
}

So your second code (jsonlint) IS json.
{
"foo": true,
"bar": 1
}
Regarding your actual question , they are both the same.
Regarding the comment :
If they are the same, but if the first example is not json, but the
second is json, what is the difference?
Let's say I have this string which should(but is not) represent json string representation :
This string comes from the server :
" {foo: true,bar: 1}"
Now I want to Parse it.
Running
JSON.parse(" {foo: true,bar: 1}")
Will fail :
SyntaxError: Unexpected token f
However :
JSON.parse("{\"foo\": true,\"bar\": 1}")
Will do just fine
Object {foo: true, bar: 1}
So here is a difference (one difference example) .
Speaking of how JS see/treats both objects (Objects !!! , I didn't say json cuz the first one is not json) - they are the same.
PS , another helpful feature is that props are considered as strings even if you didnt use "myProp" :
example :
var a={myProp:1}; //notice no `"`
var b="myProp";
a[b]=2;
alert(a.myProp) //2