Since we start adding from the initial value and not from 0, we only iterate num - 1 times, instead of num times.
One way to do this is to start the counter from 1 instead of 0. Add var i = 1; i < num; i++.
Make sure to pick var i = 1 followed by ; and then i < num, ;, i++.