Return to Snippet

Revision: 36147
at November 18, 2010 20:41 by Mosaic


Initial Code
function getKeyStr(j, ar){ //recupera la chiave partendo da il valore di un array
            var i;
            for(i in ar){
                if (j == ar[i]){
                    return i;
                }
                else{continue;}
            }
        }

Initial URL

                                

Initial Description
/*Coded by Alessio Delmonti - www.tecnocrazia.com*/

Initial Title
[JS] Find key from value

Initial Tags
javascript, array

Initial Language
JavaScript