-4
{"rec_no":1,"created":1653825421607,"record":{"empname":"122","empid":"fcas","emphra":"122","empded":"122","empda":"122","empsal":"122"},"updated":1653929155420}

this is resultObj, how do i access empname here?

Like this:

const rec = {
  "rec_no": 1,
  "created": 1653825421607,
  "record": {
    "empname": "122",
    "empid": "fcas",
    "emphra": "122",
    "empded": "122",
    "empda": "122",
    "empsal": "122"
  },
  "updated": 1653929155420
}

console.log(rec.record.empname)
mplungjan
  • 155,085
  • 27
  • 166
  • 222
  • Please visit [help], take [tour] to see what and [ask]. Do some research, search for related topics on SO; if you get stuck, post a [mcve] of your attempt, noting input and expected output, preferably in a [Stacksnippet](https://blog.stackoverflow.com/2014/09/introducing-runnable-javascript-css-and-html-code-snippets/) – mplungjan May 30 '22 at 17:53
  • Next time please parse your JSON snippets appropriately. The syntax of it is also invalid. – vfioox May 30 '22 at 17:53
  • {"rec_no":1,"created":1653825421607,"record":{"empname":"122","empid":"fcas","emphra":"122","empded":"122","empda":"122","empsal":"122"},"updated":1653929155420} – Sanjay Kumar May 30 '22 at 18:14
  • how to access empname here – Sanjay Kumar May 30 '22 at 18:14

0 Answers0