I have an object like that
[{"created_at":"Thu Aug 15 11:45:05 +0000 2013","id":367975226434670592,"id_str":"367975226434670592","text":"What makes @asana the 'Tesla of productivity tools': http:\/\/t.co\/TFzHFEpXqJ"}]
And I am interested only in 'text' part in this object.
I tried
var obj = JSON.parse(data);
console.log( obj.text );
but It didn't work, help ?
Imdad
6,0424 gold badges37 silver badges53 bronze badges
asked Aug 15, 2013 at 11:48
Mohamed Naguib
1,7506 gold badges23 silver badges32 bronze badges
1 Answer 1
You are parsing an array containing your object as its only element. Try obj[0].text.
answered Aug 15, 2013 at 11:52
Drew R
3,0983 gold badges22 silver badges27 bronze badges
Sign up to request clarification or add additional context in comments.
1 Comment
Harry
jepp thats what I expected.
lang-js
console.log( obj );show you?console.log( obj );show you?