Get immediate access to this and over 1,500+ other videos and books.

Boost your skills with a raywenderlich.com Beginner subscription. With over 60+ video courses and our core foundational programming books bundled in one subscription, it’s simply the best investment you can make in your development career.

Challenge: Create a Function

This video was last updated on Jun 21 2022

Now that you have a good idea about functions, your first challenge in this course is to write your very own function. Don’t worry - it’s not too hard.

Contributors

Heads up... You've reached locked video content where the transcript will be shown as obfuscated text.

You can unlock the rest of this video course, and our entire catalogue of books and videos, with a raywenderlich.com Professional subscription.

At this point, you should feel pretty good idea about working with functions. So naturally, I have a challenge with you. In this episode, you’re going to get three challenges. So let’s get started.

String youAreWonderful
String youAreWonderful(String name) {

}
return 'You are wonderful, $name';
print(youAreWonderful('Douglas'));
String youAreWonderful(String name, int numberOfPeople) {
return 'You are wonderful, $name. $numberOfPeople people think so.';
print(youAreWonderful('Douglas', 10));
String youAreWonderful({ String name, int numberOfPeople } ) 
String youAreWonderful({ required String name, int numberOfPeople } ) 
String youAreWonderful({ required String name, int numberOfPeople = 30} ) 
print(youAreWonderful(name: 'Douglas', numberOfPeople: 10));
print(youAreWonderful(name: 'Jeremy'));

Reviews

Comments