I mean what is difference between : " const list =[1,2,3]
" and "var list= const[1,2,3]
"
The main difference is immutability.
const list =[1,2,3] This is create constant list where list is mutable. So, you can modify it's element but you can't change list reference.
var list= const[1,2,3] In this case we create variable list where value is constant. In this case both list and reference are immutable. So we can't modify element of list nor assign difference list.
const list1 = [1, 2, 3];
var list2 = const [1, 2, 3];
list1[0] = 5; // This is allowed
list2[0] = 5; // This give you compilation error