Why does my code keep crashing?! Is there a bug in the challenge?

Why does my code keep crashing?! Is there a bug in the challenge?
0

#1

The following is my code, and for some reason it keeps crashing. I don’t understand why, can someone please help?

function sumFibs(num) {

var allFibs = [ ];
allFibs[0] = 1;
allFibs[1] = 1;

for (var i = 1; i <= num; i++) {
allFibs.push(allFibs[i] + allFibs[i - 1]);
}

return allFibs;

//This code should return an array with all the fibonacci numbers before the number entered into the function


#2

Here you don’t have closing } for the function body


#3

That was a typo, sorry. I did have it in my code. It doesn’t change anything and still causes my browser to crash. :confused:


#5

Does is store the cookies to the profile itself? because I just tried running the code on another computer and it caused it to crash the webpage again. :confused:


#7

Okay, will do. Thanks. Did you copy and paste it run it? If so, did it work fine?