Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SWIFT

Swift Function Return Type

// function definition
func findSquare (num: Int) -> Int {
  var result = num * num
  return result
}

// function call
var square = findSquare(num: 3)

print("Square:",square)
Source by medium.com #
 
PREVIOUS NEXT
Tagged: #Swift #Function #Return #Type
ADD COMMENT
Topic
Name
4+7 =