Const
is baked into the client code. Readonly
isn't. But const
is faster. May be only slightly though.
The question is, is there ever any scenario where you should prefer const
over readonly
? Or to rephrase, are we not practically always better off using a readonly
instead of a const
(keeping in mind the above-said baking thing)?