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 trialLuis Chiappe
Courses Plus Student 10,636 PointsWhat is the real difference between mixins and functions?
Work the same. On what moment I need to use functions vs mixins?
2 Answers
Ali M Malik
33,293 PointsThey can serve the same purpose and often can be interchangeable, as with many things in programming, the answer is use logic. Even though they may serve a similar function, their purposes are a bit different. Mixins are used more for includes and functions are more for returning values. The sass way has a nice write up on the two.
Hope this helps.
Luis Chiappe
Courses Plus Student 10,636 PointsThanks :)