Quantcast
Channel: Extend Basic Types in TypeScript, Error: "_this is not defined..." - Stack Overflow
Viewing all articles
Browse latest Browse all 5

Answer by stride for Extend Basic Types in TypeScript, Error: "_this is not defined..."

$
0
0

In exactly similiar case i do it like that:

interface String {    endsWith(str);    startsWith(str);}

This is just to satisfy the compiler. You implement the methods exactly like in javascript.

Hope that helps.


Viewing all articles
Browse latest Browse all 5

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>