Using The Non-Null Assertion Operator To Fix .shift() and .pop() Errors In TypeScript 3

added by JavaScript Kicks
3/16/2019 2:50:24 PM

809 Views

Ben Nadel uses the "Non-Null Assertion" operator (!) in TypeScript to tell the compiler that an expression always evaluates to a non-null value. This can fix "possibly undefined" compiler errors thrown when using the Array methods .shift() and .pop().


0 comments