whereas when the option is checked the following expression is required:
var result = new Array(); for (var i = 0; i < N; i ++) result[i] = i; result
- The first line creates a variable called result and assigns an empty array to it.
- N is a reserved variable containing the number of observations in the data.
- A Loop is being used to iterate through all the N values.
Similarly, if adding two variables, q3 and q4, rather than write q3 + q4 we need to write:
var result = new Array(); for (var i = 0; i < N; i ++) result[i] = q3[i] + q4[i]; result