Table 2 Exercises

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")) {
  ...

1. Write code to print all the rows where the name starts with "X".


2. Write code to print all the rows where the name starts with "Xz".


3. Write code to print all the rows where the name ends with "x".