GithubHelp home page GithubHelp logo

Comments (6)

ljharb avatar ljharb commented on August 31, 2024

I'm not sure how import vs require makes usage of the package any different - the README already has an example of both modular and shimmed usage.

In general, examples for feature X shouldn't rely unnecessarily on feature Y - in this case, for..of support.

from object.entries.

C3realGuy avatar C3realGuy commented on August 31, 2024

That's a point, but still i had to dig into the code to understand how things are working, wouldn't use Object.entries without an ES6 syntax, but that's more a personal preference. I think the ES6 example is more clear how Object.entries is useful as some assert.deepEqual(Object.entries(obj), expected);. I never used this assert module, maybe i'm missing something out. Anyways, the example relies on this assert module, which is not needed to use Object.entries and therefore not a good and self explaining example in my opinion.

If we think about the future, ES6 will be the standard, why not give it a short example?
I'm using Object.entries only for [key, value], that was the reason i looked for this module, and maybe some others are doing this too. A self explaining example would be a good thing.

from object.entries.

ljharb avatar ljharb commented on August 31, 2024

Sure, PRs welcome.

Fwiw, assert is both a nice core module and common pseudocode throughout CS and every language to denote assertions.

from object.entries.

pabrams avatar pabrams commented on August 31, 2024

How do I use the 'auto.js' functionality? I don't want to add a bunch of code; that's what I'm trying to avoid by using a polyfill.

from object.entries.

ljharb avatar ljharb commented on August 31, 2024

@pabrams import 'object.entries/auto' or require('object.entries/auto') in your app's entry point is sufficient.

from object.entries.

ljharb avatar ljharb commented on August 31, 2024

Closing for now; happy to accept documentation PRs in the future.

from object.entries.

Related Issues (12)

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.