hope you are all doing great.
I want to know is there any way we can convert string to a variable name? I want to convert "minXLabel" to minXLabel and use it inside span tags like this <span>{{minXLabel}</span>
I have
<div class="placeholder-value">
<span>{{ inputsArray[index].firstOption || placeholder[index].first}} - </span>
<span>{{ inputsArray[index].secondOption || placeholder[index].second}}</span>
</div>
and the input array is
inputsArray : [
{ 'firstOption': "minXLabel", 'secondOption': "maxXLabel" },
{ 'firstOption': "minXLabel", 'secondOption': "minYLabel" },
{ 'firstOption': "maxYLabel", 'secondOption': "maxXLabel" },
{ 'firstOption': "maxYLabel", 'secondOption': "minYLabel" }
],
I can do that manually with <span>{{ minXLabel || placeholder[index].first}} - </span> but because I want to output in a loop with different keys I need to convert that string into a variable name.