Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialjohn larson
16,594 Pointscan I separate an argument in a function to an " if else " statement?
I want to figure it out myself if it's possible. I just want to know if it's possible.
1 Answer
LaVaughn Haynes
12,397 PointsYou can do something like "if an argument was passed in then use it otherwise use some other value". You can also pass an "if" statement wrapped in a function as an argument. Or you can use an if statement in your function.
john larson
16,594 Pointsjohn larson
16,594 Pointsok, it's possible, I just need to do it. Thank you.
LaVaughn Haynes
12,397 PointsLaVaughn Haynes
12,397 PointsNo problem. If you need any examples let me know