let values = [3.0,6.0,9.0,1.0] let squares = values.map {$0 * $0} print(squares)
let values = [3.0,6.0,9.0,1.0]
let squares = values.map {$0 * $0}
print(squares)
func sumSq(s: [Int]) -> Int { return s.map{$0 * $0}.reduce(0, +)}
Also in Swift:
- hide bottom tab bar swift
- swift function in a variable
- hide status bar in tableview cell in swift
- convert string to base64 swift
- swift change label text
- Link swiftui
- swift initialize array with size
- how do change title color in navigation bar
- shapes in swiftui
- add top corner radius swift
- round up swift
- swift subtract dates
- rotate image animated swift
- timer in swift stack overflow
- uilabel font size swift
- async await swift
- how to check object is nil in swift
- swift uitextfield only numbers keyboard lock programmatically
- swift create array from range
- connect old iphone with latest xcode 12 or 13
- let values = [3.0,6.0,9.0,1.0] let squares = values.map {$0 * $0} print(squares)
- swift filter array
- swift empty an array
- swift set keyboard next functionality