Return to Snippet

Revision: 37140
at December 4, 2010 12:06 by joaobarbosa


Initial Code
var stringOri = "string";
var stringLen = stringOri.length;
var reverse = '';
var x = 0;

while(x < stringLen+1){	
    reverse += stringOri.substr(stringLen-x,1);
    x++;
}

document.write(reverse); // vai retornar "gnirts"

Initial URL

                                

Initial Description

                                

Initial Title
String de trás para frente

Initial Tags

                                

Initial Language
JavaScript