Nowy kurs! Każdy programista powinien nauczyć się Generative AI!
Wypróbuj darmową lekcję0
What is meant by type annotations mean?
Type annotations means it ensure that your code is clear about the constant or variable declared
1 Odpowiedź
- 1
Swift is extremely good in inferring the variable type, so you don't use much type annotation. Let me show you:
var age = 10
Swift inferred an Int type to age, but you can type annotate it too, like this:
var age: Int;
var age = 10