Git Product home page Git Product logo

Comments (4)

Xotic750 avatar Xotic750 commented on June 15, 2024 1

Ok, I don't think that I'd describe it as a loop as it returns unconditionally, I wasn't suggesting that it was broken more a strange use of for.

from es6-shim.

cscott avatar cscott commented on June 15, 2024

Yes, looks to be a think-o dating from f77f9f5. The current spec is https://www.ecma-international.org/ecma-262/6.0/#sec-%arrayiteratorprototype%.next and doesn't have a for loop. (I think the for loop was from some intermediate stage where we were expecting to skip entries in sparse arrays.)

from es6-shim.

ljharb avatar ljharb commented on June 15, 2024

Of course it loops - it just doesn't have an initializer, because var i = this.i is already done higher up in the function.

There certainly may be a better way to express it, but there's nothing broken about it.

from es6-shim.

ljharb avatar ljharb commented on June 15, 2024

Going to close this; but if there's a compelling reason to refactor that code (including "is much clearer to read") then a PR would be welcome!

from es6-shim.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.