< CS101
These exercises use the startsWith and endsWith functions on the baby name data. The baby fields are "name", "rank", "gender", "year". As a reminder, here is the key line from the lecture example -- testing if the name field in a row begins with "Ab":
... if (row.getField("name").startsWith("Ab")) { ...
Write code to print all the rows where the name starts with "X".
Write code to print all the rows where the name starts with "Xz".
Write code to print all the rows where the name ends with "x".
Each click of a Run button saves that code on the computer running the browser. The button below retrieves the all code exercises listed to the right of the button.
count 3 : table-2-ex1 table-2-ex2 table-2-ex3
(code appears here)