Domanda di colloquio di EPAM Systems

Write a function that reverses a given string.

Risposta di colloquio

Anonimo

2 lug 2026

function reverseString(str) { let reversed = ""; for (let i = str.length - 1; i >= 0; i--) { reversed += str[i]; } return reversed; } console.log(reverseString("hello"));