Tuesday, May 22, 2018

decorators in TypeScript

This touches on them some. I made the following in playing with a decorator that throws first 13 and then 42 in alerts.

function tusk(constructor: Function) {
class Walrus{
   fatness: number;
   constructor(_fatness:number) {
      this.fatness = _fatness;
let walrus = new Walrus(42);


The walrus example doesn't make any sense, does it?

No comments:

Post a Comment