mirror of
https://github.com/hanzoai/tsgo.git
synced 2026-10-30 19:37:15 +00:00
24 lines
447 B
TypeScript
24 lines
447 B
TypeScript
//// [tests/cases/conformance/controlFlow/controlFlowBinaryAndExpression.ts] ////
|
|
|
|
//// [controlFlowBinaryAndExpression.ts]
|
|
let x: string | number | boolean;
|
|
let cond: boolean;
|
|
|
|
(x = "") && (x = 0);
|
|
x; // string | number
|
|
|
|
x = "";
|
|
cond && (x = 0);
|
|
x; // string | number
|
|
|
|
|
|
//// [controlFlowBinaryAndExpression.js]
|
|
"use strict";
|
|
let x;
|
|
let cond;
|
|
(x = "") && (x = 0);
|
|
x; // string | number
|
|
x = "";
|
|
cond && (x = 0);
|
|
x; // string | number
|