I have below code where I am converting json.stringify and getting below output
let theData = JSON.stringify(helper.getData(component));
console.log('theData>>>' + theData);
output:
{"userName":"[email protected]","profile":"Sales","Account":"Self","Contact":"Personal","Time":"IST"}
I need to get profile value in one var/let, but I am not able to understand how I can get the specific value.
I tried this but not working
var Profile = theData[0].get('profile'))
getting error. Please help
Best Answer
first you don't need to do JSON.stringify because its returning object.
so you can simple get profile value using below code
second way:
Hope its help