Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR TYPESCRIPT

typescript !

let a = document.getElementById('hello');

if (a) {
    a.style.width = '100px';
}

! is used when you know that element cannot be null
const a = document.getElementById('hello');

a!.style.width = '100px';
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #typescript
ADD COMMENT
Topic
Name
9+3 =