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?✗ Incorrect
length() returns the number of items in the list, which is 3 here.Which function gets the second item from a list in Sass?
✗ Incorrect
nth() returns the item at the given index.What does
join(1 2, 3 4) produce?✗ Incorrect
join() combines two lists into one.How do you add a single item to the end of a list in Sass?
✗ Incorrect
append() adds one item to the end of a list.What does
length(()) return?✗ Incorrect
An empty list has length 0.
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.