Make sure you’ve opened the Table Methods Starter File on your computer, and clicked "Run".
Ordering Rows
1 What does animals-table.order-by("name", true)
evaluate to?
2 What does animals-table.order-by("age", false)
evaluate to?
3 Sort the animals table from heaviest to lightest.
4 Sort the animals table alphabetically by species.
5 Sort the animals table by how long it took for each animal to be adopted, from longest to shortest adoption time.
6 What do .order-by
and .row-n
have in common? How are they different?
Filtering Rows
7 What does animals-table.filter(lookup-fixed)
evaluate to?
8 What does animals-table.filter(is-dog)
evaluate to?
9 Write the code to generate a table showing only the old animals.
10 What do the contracts for lookup-fixed
, is-dog
, and is-old
have in common?
11 What happens if you evaluate animals-table.filter(lookup-name)
?
12 Find the Contract for .filter
. What is its Domain?
13 Where else have we seen functions that consume functions?
Building Columns
14 What does animals-table.build-column("old", is-old)
evaluate to?
15 What does animals-table.build-column("sticker", label)
evaluate to?
16 In your own words, how does the .build-column
method work?
These materials were developed partly through support of the National Science Foundation, (awards 1042210, 1535276, 1648684, and 1738598). Bootstrap by the Bootstrap Community is licensed under a Creative Commons 4.0 Unported License. This license does not grant permission to run training or professional development. Offering training or professional development with materials substantially derived from Bootstrap must be approved in writing by a Bootstrap Director. Permissions beyond the scope of this license, such as to run training, may be available by contacting contact@BootstrapWorld.org.