First, create the variable that will hold the heart rate data from the heart rate sensor.

Yes!

Make sure to assemble var heartRate; in your code.