Created
August 27, 2021 10:13
-
-
Save eamonnboyle/b925702a03a22670cc48abf58c02a875 to your computer and use it in GitHub Desktop.
TS 4.4 - Aliased Condition
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const isTextArea = 'rows' in input; | |
if (isTextArea) { | |
// Narrowing has NOT taken place | |
input.rows = 25; // Compiler error | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment