0
0
SASSmarkup~5 mins

Built-in list functions in SASS - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What does the length() function do in Sass lists?
It returns the number of items in a list. For example, length(1 2 3) returns 3.
Click to reveal answer
beginner
How do you get the first item of a list in Sass?
Use the nth() function with index 1. For example, nth(10 20 30, 1) returns 10.
Click to reveal answer
intermediate
What does the join() function do in Sass?
It combines two lists into one. For example, join(1 2, 3 4) returns 1 2 3 4.
Click to reveal answer
intermediate
Explain the difference between append() and join() in Sass lists.
append() adds a single item to the end of a list, while join() combines two lists into one longer list.
Click to reveal answer
beginner
How can you check if a list is empty in Sass?
Use length() and check if it returns 0. For example, length(()) == 0 means the list is empty.
Click to reveal answer
What does length(10 20 30) return in Sass?
A30
B3
C10
DError
Which function gets the second item from a list in Sass?
Aappend()
Blength()
Cjoin()
Dnth()
What does join(1 2, 3 4) produce?
AError
B1 2
C1 2 3 4
D3 4
How do you add a single item to the end of a list in Sass?
Aappend()
Bjoin()
Clength()
Dnth()
What does length(()) return?
A0
B1
CError
Dnull
Describe how to get the third item from a Sass list and how to find out how many items it has.
Think about how you count items and pick one by position.
You got /3 concepts.
    Explain the difference between append() and join() when working with Sass lists.
    One adds a single item, the other merges lists.
    You got /3 concepts.