Type Assertion

type assertion is like a type cast in other languages, but performs no special checking or restructuring of data. It has no runtime impact, and is used purely by the compiler. if you don’t assign value at the time of declaration of let keyword you don’t get intellisense after dot place variable name.

let mm;
mm = “sagar”;
let endswith = (mm).endsWith(“r”);

let mm;
mm = “sagar”;

let endswith = (mm).endsWith(“r”);
let alternative = (mm as string).endsWith(“r”);

Sagar-jaybhay-TypeAssertion

Below is the video explain TypeAssertion.

Sagar Jaybhay, from Maharashtra, India, is currently a Senior Software Developer at Software Company. He has continuously grown in the roles that he has held in the more than seven years he has been with this company. Sagar Jaybhay is an excellent team member and prides himself on his work contributions to his team and company as a whole.

Sagar Jaybhay

Sagar Jaybhay, from Maharashtra, India, is currently a Senior Software Developer at Software Company. He has continuously grown in the roles that he has held in the more than seven years he has been with this company. Sagar Jaybhay is an excellent team member and prides himself on his work contributions to his team and company as a whole.

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *