As opposed to this, something like this could live in a file by itself somewhere.
export class Redundant {
public doubleUp(key: string):string {
return key + key;
}
}
You could import it where you need it as you would normally and then turn around and use it like this:
let song:string = "Daddy's little baby loves" + Redundant.doubleUp(" shortnin");
No comments:
Post a Comment