Run TypeScript 5 online — typed JavaScript, Node runtime, browser-hosted.
TypeScript is JavaScript with a serious type system: interfaces, generics, mapped types, conditional types. It compiles to JS and runs on Node — you get type-safety at compile time and JavaScript's ecosystem at runtime.
ls-judge compiles TypeScript 5 with tsc and runs the emitted JS on Node inside a Firecracker microVM.
Clicking "Run now" opens the playground with this exact code and a matching test case pre-loaded — passes on first Run.
const lines: string[] = [];
process.stdin.on('data', (d: Buffer) => lines.push(d.toString()));
process.stdin.on('end', () => {
const n: number = parseInt(lines.join('').trim());
process.stdout.write((n * 2) + '\n');
});
21
42