I am trying to have a more dynamic function and would like to allow the functions instance name were it outputs the text to be changeable.
for example
function example_function(url,instance_name){
instance_name.text = url;
}
example_function('www.example.com','url_txt');
example_function('www.another.com','more_txt');
Is this possible?
Yes, just parse the string into square brackets next to the instance’s owner. For example:
More info:
Take this object:
Its properties can be accessed either as you’d expect:
Or as mentioned above:
I suggest using a function like this one I’ve created to tighten your code up a bit: