Lesson 7 - Activity 1: Do you need help working with functions?

Time: 1 - 5 hours

Purpose: This activity helps you get familiar with functions in JavaScript by tasking you with using them in the random data generator.

Introduction: Our code currently has a lot of repetition in it which needs to be cleaned up and encapsulated properly.

For this activity, you can either use your existing random data generator code you’ve created or you can use this example code-base.

Task: Update your current random data generator code-base to:

  1. Use a function to remove any duplicate code
  2. Replace the ‘prices’ arrray with a function that will create a random integer

If you need help, post questions on this thread for support.