- 第一项
- 第二项
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | void main(){ | |
| List? list; | |
| print(list?.length); // would not throw null exception, just print null | |
| print(list?.length??0); // 0 | |
| } | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | void main() { | |
| var student = Student('tie', 'li si', 2); | |
| print(student.name); // zhang san | |
| print(student.country); // China | |
| print(student.age); | |
| var enigeer = Enigeer('dart', 'wang er', 34); | |
| print(enigeer.name); | |
| enigeer.walk(); // call the mixin walk's method | |
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | void main(){ | |
| List list = ['a','b',2]; | |
| Map map = {'name':'san','age':2}; | |
| print('***loop map***'); | |
| map.forEach((k, v) => print("Key : $k, Value : $v")); | |
| print('***loop map by keys***'); | |
| map.keys.forEach((k) => print("Key : $k")); | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | void main(){ | |
| dynamic x = 'foo'; | |
| print(x is String); | |
| print(x.runtimeType); | |
| x = 123; // no compile error | |
| print(x.runtimeType); | |
| var y = 'bar'; | |
| print(y.runtimeType); | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | boolean: | |
| - TRUE #true,True 都可以 | |
| - FALSE #false,False 都可以 | |
| float: | |
| - 3.14 | |
| - 6.8523015e+5 #可以使用科学计数法 | |
| int: | |
| - 123 | |
| - 0b1010_0111_0100_1010_1110 #二进制表示 | |
| null: | 
新开一个tab预览当前MD, preview MD cmd+shift+v
https://code.visualstudio.com/docs/nodejs/working-with-javascript
{
  "compilerOptions": {
 "module": "commonjs",
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | npm list -g --depth 0 | |
| npm config set registry https://registry.npm.taobao.org | |
| npm config get registry | |
| npm install express --registry https://registry.npm.taobao.org | 
NewerOlder