Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3304698
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T21:05:22+00:00 2026-05-17T21:05:22+00:00

One of the new mechanisms available in JavaScript 1.7 is yield , useful for

  • 0

One of the new mechanisms available in JavaScript 1.7 is yield, useful for generators and iterators.

This is currently supported in Mozilla browsers only (that I’m aware of). What are some of the ways to simulate this behavior in browsers where it is not available?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T21:05:23+00:00Added an answer on May 17, 2026 at 9:05 pm

    Well you could always write an outer function that initializes variables in a closure and then returns an object that does whatever work you want.

    function fakeGenerator(x) {
      var i = 0;
      return {
        next: function() {
          return i < x ? (i += 1) : x;
        }
      };
    }
    

    Now you can write:

    var gen = fakeGenerator(10);
    

    and then call gen.next() over and over again. It’d be tricky to simulate the “finally” behavior of the “close()” method on real generators, but you might be able to get somewhere close.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is a new one for me: What does this error indicate? /usr/bin/perl: bad
This concept is a new one for me -- I first came across it
Case One: new Date(Date.parse(Jul 8, 2005)); Output: Fri Jul 08 2005 00:00:00 GMT-0700 (PST)
I create one new application.i add the contact from address book see the code
The team talks about one new effect released in jQUery UI 1.8. Which one
I want to close out my old question start a new one with a
I am moving from an old php based site to a new one based
I want to update a .class file in a jar with a new one.
Consider that I have 1 resource and 2 urls (let's say new one and
var array1 = {}; array1['one'] = new Array(); array1['one']['data'] = 'some text'; array1['one']['two'] =

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.