Make use of the solution templates. These should help you also to get a better understanding of the tasks.

Javascript

  1. Write a function to set the innerHTML of an object identified by its id to a given value.
  2. Write a reduce function for Javascript arrays, in analog to Python's reduce. It should produce e.g.

    reduce([1, 2, 3], function(x, y) { return x + y; }, 0) === 1 + 2 + 3;

  3. Write a function to add a reduce method to the Array prototype. After calling the function, one should be able to get

    [1,2,3].my_reduce(function(x, y) { return x * y; }, 1) === 1 * 2 * 3;

Python

  1. In the flask app provided in the templates, complete the route that returns the raw JSON data created from input_data.
  2. In the flask app provided in the templates, complete the route that returns the prediction from a linear regression for some future values stored in a variable called future_vals.