Domanda di colloquio di Media.net

Reverse a string without inbuilt functions of JavaScript.

Risposta di colloquio

Anonimo

28 mag 2022

function revrsStr(str){ var a = ""; for(let i = str.length-1; i > 0; i++){ a +=str[i] } return a } console.log(revrsStr('JavaScript'));