Google Chrome: JavaScript associative arrays, evaluated out of sequence

前端 未结 7 2109
耶瑟儿~
耶瑟儿~ 2020-12-07 02:24

Ok, so on a web page, I\'ve got a JavaScript object which I\'m using as an associative array. This exists statically in a script block when the page loads:

v         


        
7条回答
  •  感情败类
    2020-12-07 02:31

    Contrary to all the other answers, it is CERTAINLY A BUG IN CHROME

    The reason:

    If the data structure is a paper sack like Barry said then:

    The values should always be randimized. This is not the case in chrome

    If the data structure is sequential then:

    The values should be in the sequence in which they are added to the structure

    While other browsers follow the second approach, chrome follows neither and there is still no explanation of what is the sorting order chrome makes up for the data structure while it is accessed.

提交回复
热议问题