why this code didn't work corectly? : I have a following probleb to resolve, i don't understand why my code didnt work corectly. 

Here is  the problem to resolve:

Write a JavaScript function that takes as input an array of two numbers (start and end) and prints at the console a HTML table of 3 columns. The first column should hold a number num, changing from start to end. The second column should hold num*num. The third column should hold "yes" if num is Fibonacci number or "no" otherwise. The table should have header cells titled "Num", "Square" and "Fib". See the below examples.
Input
The input data comes as array of two numbers: start and end. The input data will always be valid and in the format described. There is no need to check it explicitly.
Output
Print at the console the above described table in the same format like the examples below. Don't add additional spaces. Whitespace and character casing are important, so please use the same as in the below examples.
Constraints
•	The input is passed to the first JavaScript function found in your code as array of 2 elements.
•	The numbers start and end are positive integers in the range [1…1 000 000] and start ≤ end.
•	Allowed working time for your program: 0.2 seconds.
•	Allowed memory: 16 MB.

This code is not the same by the requirement of problem, but the idea is the same I guess.

Here is my code:

<!-- begin snippet: js hide: false -->

<!-- language: lang-js -->

    var fib = [];
    var a, b, result;
    a = 0;
    b = 1;
    result = b;
    for (var i = 1; i < 31; i++) {
        result = a + b;
        a = b;
        b = result;

        fib.push(result);
    }
    console.log("<table>");
    console.log("<tr><th>Num</th><th>Square</th><th>Fib</th></tr>");
    var start = 2;
    var end = 6;
        function isFib(start, end) {
            for (i = start; i < end; i++) {
                fib.forEach(function (element) {
                    if (i === element) {
                        return "yes";
                    }
                    else
                    {
                        return "no";
                    }
                });
            }
        }
    function buildTable() {
        for(var j = start; j < end; j++) {
            console.log("<tr><td>" + j + "</td><td>" + j * j + "</td><td>" + isFib(start, end) +  "</td></tr>");
        }
    }
    buildTable(start, end);

<!-- end snippet -->

This code is not the same by the requirement of problem, but the idea is same i guess.
