why this code didn't work correctly?
<p>I have the following problem to resolve, I don't understand why my code doesn't work correctly. </p>

<blockquote>
  <p>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. </p>
  
  <ul>
  <li>Column 1 should hold a number <code>num</code>, changing from start to end. </li>
  <li>Column 2 should hold <code>num*num</code>. </li>
  <li>Columns 3 should hold "yes" if <code>num</code> is Fibonacci number or "no" otherwise. </li>
  </ul>
  
  <p>The table should have header cells titled "Num", "Square" and "Fib". See the below examples.  </p>
</blockquote>

<p><strong>Input</strong><br>
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.  </p>

<p><strong>Output</strong><br>
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.</p>

<p><strong>Constraints</strong><br>
•   The input is passed to the first JavaScript function found in your code as array of 2 elements.<br>
•   The numbers start and end are positive integers in the range [1…1 000 000] and start ≤ end.<br>
•   Allowed working time for your program: 0.2 seconds.<br>
•   Allowed memory: 16 MB.  </p>

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

<p>Here is my code:</p>

<p><div class="snippet" data-lang="js" data-hide="false">
<div class="snippet-code">
<pre class="snippet-code-js lang-js prettyprint-override"><code>var fib = [];
var a, b, result;
a = 0;
b = 1;
result = b;
for (var i = 1; i &lt; 31; i++) {
    result = a + b;
    a = b;
    b = result;

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

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