function fibonacciGenerator (n) {
var outPut = [];
if (n === 1){
outPut = [0];
}
else if (n === 2){
outPut = [0,1];
}else{
outPut = [0,1];
for(var i = 2; i < n; i++){
outPut.push(outPut[outPut.length - 2] + outPut[outPut.length - 1])
}
}//Return an array of fibonacci numbers starting from 0.
console.log(outPut)
return outPut
}
fibonacciGenerator(8);