Function variable inside variable | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 6

Function variable inside variable

I tried this but it doesnt work it just uses var instead of the string that the variable contains. function test(var){ otherFunction(var,true); }

23rd Apr 2018, 8:04 PM
Arne Van Kerckvoorde
Arne Van Kerckvoorde - avatar
2 Answers
+ 3
var isnt a valid variable name and this should produce an error,var is a keyword so i dont understand your question
23rd Apr 2018, 8:19 PM
᠌᠌Brains[Abidemi]
᠌᠌Brains[Abidemi] - avatar
+ 2
This was just an example the variable name is cost
23rd Apr 2018, 9:26 PM
Arne Van Kerckvoorde
Arne Van Kerckvoorde - avatar