1. 使用for in排序时,整数的属性会按照从小到大的顺序排序,其他属性则按照创建的顺序显示
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    let codes = {
    "49": "Germany",
    "test2":"wuwuwu",
    "41": "Switzerland",
    "44": "Great Britain",
    "test1":"hahaha",
    "1": "USA",
    };

    for (let codesKey in codes) { // 整数的属性会被排序,其他属性按照创建的顺序显示
    console.log(codesKey); // 1 41 44 49 "test2" "test1"
    }