I have a scenario where I define two objects. The first object, BOB, has properties "name" with a value of "bob" and "height" with a value of 185.
var BOB = {
"name": "bob",
"height": 185
};
The second object, PROPS, references the height property from the BOB object.
var PROPS = {
"bob": {
"height": BOB.height
};
As a result, PROPS.bob.height
will be equal to 185
. When stringified, the object looks like this:
{"bob": {"height": 185}}
Now, the challenge is to determine the original source code that evaluated to the value 185
. Is it possible to extract the string representation of the code that produced that result?
var s = findOutTheSourceCode(PROPS);
// The expected output for s would be
/*
{
"bob": {
"height": BOB.height
}
*/