Web App Development with Google Apps Script/exercises
Appearance
Javascript exercises
[edit | edit source]Arrays
[edit | edit source]Could probably fit on one line of code If you have an array of [1,3,5,9] and want to produce an array of all those numbers squared, how would you do it? |
grab column Assuming you have a 2D array (like the rows and columns of a spreadsheet), how would you produce a variable with just the third column? |
every other row How could you grab every other row of a 2D array? |
Row filtering How would you get only rows where column A is bigger than column B and column C is one of the following: ["hi", "there", "you", "cool", "person"] ? |
Gracefully find a row How would you look to see if a row has your email in any of the cells and return either your row or a note saying it couldn't be found? |
Count rows that match Write code that allows the rows to be searched and returns the number of rows that match |
Produce table row from two sheets Assume you have a data sheet that lists the user's email. You also have a user sheet that gives more detail about each user. Return the html table syntax for each row where the data values are listed along with the full name of the user in the same row. |
Objects
[edit | edit source]Array to object Given an array like ["apples", "oranges", "bananas"] return an object like {"apples":0, "oranges":1, "bananas":2} |
Accessing elements Given this object: {"name":"Andy", "likes":{"sports":["soccer","soccourt","softball","mountain biking"], "food":["hummus","desserts"]} } how would you address "mountain biking"? |
GAS exercises
[edit | edit source]Regex exercises
[edit | edit source]Data structure exercises
[edit | edit source]Blog site What structure would you need for a blog that has allowed users, some who can post, and all who can comment? |