I am new to JS so my question is if something is feasible.

I have a plc which provide some asp functions from html. An example of code uses ReadPlc which returns the value of the variable

<p><b>Sample ASP function ReadPLC</b></p>
<p>Actual temperature:<% ReadPLC("gHeating.status.actTemp"); %> </p>
<p>Cream: <% ReadPLC("gMainLogic.par.receipe.milk"); %></p>
<p>Sugar: <% ReadPLC("gMainLogic.par.receipe.sugar"); %></p>
<p>Coffee Powder: <% ReadPLC("gMainLogic.par.receipe.coffee"); %></p>
<p>Water: <% ReadPLC("gMainLogic.par.receipe.water"); %></p>

My question is if JS in some way can dynamically exchange "gHeating.status.actTemp" with another text (from an array/list of variable names) to retrieve another variable value from the PLC?