How to obtain the name of a Javascript variable

1 posts, 0 answers
  1. Jochen Neyens
    Jochen Neyens avatar
    2 posts
    Member since:
    Oct 2003

    Posted 24 Feb 2006 Link to this post

    Is there a function that can be used to get the name of a Javascript variable? Look at the example below. Is there a function like "GetVarName"? alert(GetVarName(tt)) sould alert the text "myText" ...

    var myText = "lorem";

    function test(tt) {

Back to Top