Skip to content
TheChatArchiveThe Chat Archive
gpt-4.1-mini-2025-04-14· OpenAIAi2 WildChat-4.8M (AI2)

Rewrite this code to TypeScript. Write only code, without Markdown: while 1:…

  1. User

    User: Rewrite this code to TypeScript. Write only code, without Markdown: while 1: string=input(">>> ") if string=="0":break num=eval(string) print(num) User: Translate code Assistant:

  2. Assistant

    while (true) { const input = prompt(">>> "); if (input === "0") break; const num = eval(input as string); console.log(num); }