This example involves some JavaScript code. Currently, I have written the following:
var double = function (array) {
var newArray = [];
for(var i = 0; i<array.length; i++) {
newArray.push(array[i]);
newArray.push(array[i]);
}
return newArray;
};
...Essentially, if I input the following array:
var numbers = [1,2,3];
I would like the function to output:
[1,1,2,2,3,3]
...and so on.