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
    fedilink
    arrow-up
    5
    arrow-down
    1
    ·
    2 years ago

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