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 trialThijs Berkers
23,038 PointsWrite Sass function called double
Hi guys,
I'm getting stuck in the challenge "speeding up Workflow with Sass". The challenge is: " Write a function, called 'double', that multiplies its input by 2. "
I've tried the following thing: @function double{ @return $input($value * 2); }
Thanks.
6 Answers
Nicholas Wright
17,497 PointsMardi, you pretty much got it right. You don't need the ( ) or the ; after your @return .
Also, check the rest of your code. I wasn't passing because I had 'fontsize' and not 'font-size'
Tobia Crivellari
14,331 PointsHey guys!
Here the right code for it:
@function double($input) { @return $input * 2; }
Cya! :-D
Marguerite Seip
10,762 PointsI was stuck on this too, until I omitted the parentheses around the return value
Alan Sloan
15,618 PointsThis fixed the issue I was having as well. Thanks!
Ben Rubin
Courses Plus Student 14,658 PointsYou're not passing in a parameter. The function must take one parameter (which is the input to double). Then when the function returns a value, just return that parameter * 2. return $input($value * 2)
isn't valid code.
Mardi Kruijt
6,119 PointsHi guys, getting stuck on this to. I'm sure I had it when I used the following code. Not so lucky..
@function double($input) { @return($input * 2); }
Also I tried it with the 'unquote' function, but that didn't help. Any ideas?
Mardi Kruijt
6,119 PointsHi guys, getting stuck on this to. I'm sure I had it when I used the following code. Not so lucky..
```@function double($input) { @return($input * 2); }
Also I tried it with the 'unquote' function, but that didn't help. Any ideas?