Generation

generate functionTue, 21 Mar 2023

metodo recursivo que retorne el numero en posicion inversa

Script function invertirNumero(num){ num = num + '' //convertir a string if(num.length == 1) return num; //caso base return num[num.length - 1] + invertirNumero(num.substring(0, num.length - 1)) //caso recursivo }

Want to kickstart your project?Use the new AI Studio to create your code