List
void main() {
// List<int> type
var list1 = [1, 2, 3];
list1.add(4);
// Error: The argument type 'String' can't be assigned to the parameter type 'int'.
// list1.add("String");
var list2 = [
'Car',
'Boat',
'Plane', // 리스트 요소 끝내 콤마를 추가할 수 있습니다.
];
var constantList = const [1, 2, 3];
// Error: Unsupported operation: indexed set
// constantList[1] = 1;
}Last updated