Code Monkey home page Code Monkey logo

Comments (3)

lessfish avatar lessfish commented on May 26, 2024

的确,你是对的。这点我也不大理解,源码给了个链接 http://people.mozilla.org/~jorendorff/es6-draft.html#sec-tolength,你可以看下有没有用?(我是没大看明白)

from underscore-analysis.

hankxdev avatar hankxdev commented on May 26, 2024

underscore 这里不是判断array,更多是对array-like(类数组?)对象的判断。因此,数组的最大长度依然是 Math.pow(2,32)-1, 而这里的 Math.pow(2,53)-1是针对其他array like对象的。另外这里的Math.pow(2,53)-1 严格来说也不是array like 对象的最大长度值,而是一个“最安全整数” (MAX_SAFE_INTEGER )https://tc39.github.io/ecma262/#sec-number.max_safe_integer

from underscore-analysis.

lessfish avatar lessfish commented on May 26, 2024

@HangYang 棒!感谢指出 到时说到这一部分的时候再重点讲下 再次感谢!

from underscore-analysis.

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.