I want to see which options do I have to execute a string whichs looks for a value inside a JSON without using eval().
My JSON looks like this:
var caso = {
"_id": "C1M3bqsB92i5SPDu",
"type": "bpm",
"bpm": {
"_data": {
"_id_bpm": "bpm_solicitud_viaticos"
},
"milestones": {
"solicitud": {
"toma_de_datos": {
"nombre": "RAUL MEDINA",
"clave": "123",
"departamento": "Finanzas",
"cantidad": "456"
}
}
}
}
}
Now, I'v a string with the value:
var step = "caso.bpm.milestones.solicitud.toma_de_datos.nombre";
I'm getting the value that I want from that JSON with this:
var thevalue = eval(step);
Which are my options instead of eval()? Both efficient and easy to implement?
Thanks a lot for your help!