demo/generators.js
function fib(max) {
  var a = 0, b = 1;
  var results = [];
  while (b < max) {
    results.push(b);
    [a, b] = [b, a + b];
  }
  return results;
}
function fib(max) {
  var a = 0, b = 1;
  var results = [];
  while (b < max) {
    results.push(b);
    [a, b] = [b, a + b];
  }
  return results;
}
function fib ( max ) { var a = 0 , b = 1 ; var results = [ ] ; while ( b < max ) { results . push ( b ) ; [ a , b ] = [ b , a + b ] ; } return results ; }
Example 2. Fibonacci precomputes a fixed set
Example 2 . Fibonacci precomputes a fixed set