공부
Swift와 Dart 문법 차이
jaebijae
2024. 6. 12. 05:22
Dart | Swift | |
Type Annotation | `Double myDouble` | `let myDouble: Double` |
String declaration | `String myString = 'hi'` | `var myString: String = "hi"` |
String interpolation | `'${value}'` | `“\(value)"` |
Function | `String greet(String msg) {}` | `func greet(msg: String) -> String {}` |
Function with implicit return | `String greet() => "hi"` | `func greet() -> String {"hi"}` |
Schedule code to be executed when current scope is exited | `defer` | `finally` |