Read the question, write TypeScript on the right, then Run or Check.
QuestionHint and solution stay closed until you open them
Read one word typed as string. Log it reversed.
Examples
Input
code
Output
edoc
Input
TS
Output
ST
Hint
- [...word].reverse().join("")
Show correct code
Peek only after you have tried. You can still Check your own version.
const word: string = readLine().trim();
console.log([...word].reverse().join(""));
main.tstsc · readLine() · Ctrl + Enter
ResultIdle
Run to see output. Check grades the tests.