class Lol {
    get length() {
        console.log('Lol. LMAO even.');
        return 5;
    }
}

const noLolsAllowed = (notALol: string) => {
    for (let i = 0; i < notALol.length; ++i) {
        console.log('No lols here');
    }
}

noLolsAllowed(new Lol() as unknown as string);
  • DessalinesA
    link
    41 year ago

    God I hate webdev. And its even that much more unbearable without typescript.