Learn Swift Fundamentals by preparing for Job Interview, Questions 33~ 35 For Functions
Apr 15, 2022
The concepts I’m going to introduce now make your code more elegant. Be sure to read and understand.
33) What is variadic number of params method?
Answer:
- A method which accepts dynamic number of input arguments is known as variadic params method
34) How to set default value to a method input arguments?
Answer:
- func myName(firstName: String, lastName=”Shin”)
35) Is Swift Function Value Type
or Reference Type
?
Answer:
- It’s Reference Type