¡Nuevo curso! ¡Todo programador debería aprender IA Generativa!
Prueba una lección gratuita0
What is meant by type annotations mean?
Type annotations means it ensure that your code is clear about the constant or variable declared
1 Respuesta
- 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