re: var vs let vs const in JavaScript VIEW POST


It's 2019, it's not a good time to compare var and let/const.

What if to compare let, const and Readonly from TS/Flow?

const constVariable: Record<string, any> = {};

constVariable.b = "is it const?";

const reallyConstVariable: Readonly<Record<string, any>> = {};

reallyConstVariable.b = "is it const?";

I'll be sure to ask your permission next time I write something.

code of conduct - report abuse