Function variable inside variable | Sololearn: Learn to code for FREE!
Nouvelle formation ! Tous les codeurs devraient apprendre l'IA générative !
Essayez une leçon gratuite
+ 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 Réponses
+ 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