Skip to content

Latest commit

 

History

History
18 lines (12 loc) · 496 Bytes

script.md

File metadata and controls

18 lines (12 loc) · 496 Bytes

Semicolons

Did you know in Swift programming, we don't need to use semicolons? That's right. You don't need to use them. But... There is an interesting opportunity to use it. Semicolons allow you to combine connected elements into a single line.

import Foundation

func sum(value1: Int, value2: Int) -> Int {
    let sum = value1 + value2
    return sum
}

let total = sum(value1: 1, value2: 2)

Reference

YouTube 👀