Q:

Unable to get value from Json.parse getting undefined value in Angular js MVC

I am trying to fetch value from json.parse getting undefined value . 
here is code,
var result = JSON.parse(d.data.data);
var name = result["TasksId"];

In result variable i have value in this form:
"{
  "result": [
    {
      "AssignedBy": "724523c9-6d0d-4c69-9ee1-5d17b0271bbc",
      "UserId": "980392bd-96ce-4940-87e7-bb9e8f805f60",
      "Id": 5872,
      "TaskId": 1485
    }
  ]
}"

TaskId exist in it even than i am getting undefined 
Hopes for your suggestions
Thanks

A:

check your object, It has an array in it 
"{
  "result": [
    {
      "AssignedBy": "724523c9-6d0d-4c69-9ee1-5d17b0271bbc",
      "UserId": "980392bd-96ce-4940-87e7-bb9e8f805f60",
      "Id": 5872,
      "TaskId": 1485
    }
  ]
}"

so you must give the proper path(index) to it , so try using result['result'][0]['TaskId']

