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 trialLyric Abbott
35,595 PointsIDK WHAT IM DOING
Write a function, named multiply, that takes a value as an argument, then returns that value multiplied by 2.
1 Answer
Kevin Korte
28,149 PointsWhat have you tried so far?
Take a look at the Sass documentation found here: http://sass-lang.com/documentation/file.SASS_REFERENCE.html#function_directives
Every sass function starts with @function
, than the function name, and any variables to pass into the function inside parentheses. Inside the curly braces we have to @return
something. In this case it's whatever the value we passed in as a variable * 2
.
The example function on the Sass docs I linked above shows you exactly the syntax you need. Try plugging in the rest of the specifics of the questions into the syntax and see if you can't get it right.
Let me know how it goes.
Lyric Abbott
35,595 PointsLyric Abbott
35,595 Pointsmy code: lol
@function (multiply)
Kevin Korte
28,149 PointsKevin Korte
28,149 PointsThat's a start. I expanded above. Let me know if that helps you solve it for yourself.
Lyric Abbott
35,595 PointsLyric Abbott
35,595 Pointsmy code: whats wrong with it?
@function multiply ($input) { $return $input * 2; }
Kevin Korte
28,149 PointsKevin Korte
28,149 PointsFunctions use
@return
instead of$return
Lyric Abbott
35,595 PointsLyric Abbott
35,595 Pointsthank u so much
Kevin Korte
28,149 PointsKevin Korte
28,149 PointsYou're welcome