Files
scriptc/tests/diagnostics/expressions.ts
2026-07-22 18:08:04 -05:00

10 lines
305 B
TypeScript

const n: number = 3;
const t = n > 0 ? "pos" : "neg";
const o = { ...{ a: 1 } };
const b = "a" in { a: 1 };
const m = typeof "ab".indexOf("b"); // a CALL operand — pure computations fold now
const u = n === 3 ? 1 : 2;
const s: string = "abc";
const mixed = n === 3 && s;
console.log(t, m, u, b, mixed);