As per the title is it possible to retrieve a variable name from within a function.
For example i am passing a selector object into a function
get SAMPLE_ELEMENT () { return $('h2=example') }
This is passed into a function
verifyElementTextTranslated (element)
What i would like to get back is SAMPLE_ELEMENT
as this will be used to compare against a json file to extract the correct translation.
I've tried element.toString() but that gives me an [object, object]
back, trying just to return element
gives me the entire object back obviously.
Not sure if it is actually possible because if my understanding is correct as variable names aren't passed into the function?
Thank you