DEV Community

Discussion on: JavaScript Security 101

Collapse
 
gotheer profile image
gotheer

Conclusion :
Use Typescript.
😄

Collapse
 
charlottebrf_99 profile image
Charlotte Fereday

Could have been a 2 word post ! :)

Collapse
 
aminnairi profile image
Amin
const addNumbers = (first: number, second: number): number => {
    return first + second;
};

addNumbers(NaN, NaN);
addNumbers(-Infinity, +Infinity);
Enter fullscreen mode Exit fullscreen mode

This will compile just fine in TypeScript.

Collapse
 
charlottebrf_99 profile image
Charlotte Fereday

That's interesting thanks.