mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-10-23 06:10:02 +08:00
22 lines
420 B
TypeScript
22 lines
420 B
TypeScript
function log3(a: number, b: string, c: boolean): void {
|
|
console.log(a, b, c);
|
|
}
|
|
function reassignParam(s: string): string {
|
|
s = s + s;
|
|
s = s + "?";
|
|
return s;
|
|
}
|
|
log3(1, "two", true);
|
|
console.log(reassignParam("ha"));
|
|
|
|
function earlyReturn(n: number): void {
|
|
const label = `n=${n}`;
|
|
if (n < 0) {
|
|
console.log(label, "early");
|
|
return;
|
|
}
|
|
console.log(label, "late");
|
|
}
|
|
earlyReturn(-1);
|
|
earlyReturn(1);
|