Iteration order of for..in loops in Javascript

后端 未结 5 1736
孤城傲影
孤城傲影 2021-01-17 08:33

Suppose I have a Javascript object which is initialized

var letters = {q:0, t:0, o:0, b:0, y:0, n:0, u:0, m:0, p:0, 
               w:0, a:0, d:0, k:0, v:0,          


        
5条回答
  •  北荒
    北荒 (楼主)
    2021-01-17 09:01

    The order is defined in specifications as "arbitrary", so no; you shouldn't rely on the order being definite.

提交回复
热议问题