I have this JSON array, and what I want is to get the password field alone
var user = [ { _id: 5902086ecbc0dd11e4870fd9, password: '$2a$08$FIpkmFT1WDZggQYyBA4CVuop6pelbKBfUEJ1/KAVIV2Si9Ho1EYhi', email: '[email protected]', lastName: 'v', firstName: 'j', updatedDate: 2017-04-27T15:04:14.483Z, createdDate: 2017-04-27T15:04:14.483Z } ] I tried to parse it using this code
var obj = JSON.parse(user); console.log(user.password); but still it is undefined.
user[ index ].password;(user[0].password;for the first object ...).