object-oriented language
- Primative Types
String "hi"
bool true
int 66
doublue 66.66
- List
// List<Object> like List<any>
var numbers = [
1,
2,
3,
4,
5,
"A",
];
List<int> numbers1 = [
1,
2,
3,
4,
5,
];
collection if
var isNumberFive = true;
List<int> numbers1 = [
1,
2,
3,
4,
if(isNumberFive) 5, // possible
];
collection for
var oldFriends = ['John', 'Cat'];
var addedText = 'haha';
var newFriends = [
'lewis',
'ralph',
for (var friend in oldFriends) '$addedText $friend'
];
string interpolation : 백팁 필요X
var name = 'A Name';
var age = 19;
var greeting = 'Hello World i\'m $name and ${age + 2} old'; //21 old