no nesting vs with nesting vs assign

Edit on GitHub

GFN creation speed

Setup

window.withNesting = function () {
  return function* () {
    yield true
}
}

window.noNesting = function* () {
yield true
}

Tests

  • no nesting

    var foo = noNesting()
  • with nesting

    var foo = withNesting()()
  • assign

    var foo = true