I have 2 JSON files.
file 1
{
object: {
variable: true
}
}
and file 2
{
object2: {
tag: "object.variable
}
}
What I am stuck on is that I need to, in one javascript file, get the tag from file 2 and use it to reference the variable in file 1.
I have gotten both file 1 as a JSON and have gotten 'tag' from file 2 in my code. However I am entirely lost as to how I can go about using the string "object.variable" to get the value of object.variable from file 1.
PS (I tried using eval but had no luck, though I would like to avoid it at all costs if possible.)