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 trial

CSS Advanced Sass Advanced Functions Introspection: Part 2

juan martinez
juan martinez
40,630 Points

type-of is this the answer for the if condition ?

I don't know what to test the type-of number or string keep getting bummers

1 Answer

Chris Shaw
Chris Shaw
26,676 Points

Hi Juan,

The challenge is asking for you to use the comparable function which takes two arguments of any type and compares the two, if the two types match then we need to return the $alpha and $bravo parameters added together other 'error'.

@function add-if-comparable($alpha, $bravo) {
  @if not comparable($alpha, $bravo) {
    @return 'error';
  }

  @return $alpha + $bravo;
}

Happy coding.

juan martinez
juan martinez
40,630 Points

thanks mate wow , I was kind of lost now I see .