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

Liam Maclachlan
Liam Maclachlan
22,805 Points

How do you count the array/maps length in SCSS?

Hi guys.

I'm tidying up a flexible grid system sass function and I need to know how to count the length of of a maps key/value pairs before before a loop starts... any idea?

I hope It is simple and I'm just being lazy by asking before really looking :)

1 Answer

Liam Maclachlan
Liam Maclachlan
22,805 Points

It took 3 minutes to find the answer >_> check it out here :)

For those who don't like links, the answer is:

length ($ array)