Const Readonly | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Const Readonly

What is the difference between Const and Readonly?

22nd Oct 2021, 6:47 PM
MJARAB
MJARAB - avatar
1 Answer
+ 3
const is constant already at compilation, the value must be set at declaration readonly is constant during runtime – it may be set in the constructor of the object
22nd Oct 2021, 8:46 PM
Lisa
Lisa - avatar