Comments
// is a line comment and /* */ a block that can nest. /// writes documentation.
Example
// line
/* block /* nested */ */
/// Adds two numbers.
func add(_ a: Int, _ b: Int) -> Int { a + b }
print(add(1, 2))Exercise
Doc comment.
Adds two numbersQuiz Test
These free lessons are for learning. Join a full course for projects, mentor feedback and a verified certificate.