zoukankan      html  css  js  c++  java
  • for-in用法

    var nyc = {
        fullName: "New York City",
        mayor: "Bill de Blasio",
        population: 8000000,
        boroughs: 5
    };
    for(var i in nyc){
       
        console.log(i);
       
    }

     
    输出:
    //输出的是属性
     
    var nyc = {
        fullName: "New York City",
        mayor: "Bill de Blasio",
        population: 8000000,
        boroughs: 5
    };

    // write a for-in loop to print the value of nyc's properties
    for(var i in nyc){
        console.log(nyc[i]);
        }
     
    输出:
    //输出了属性的内容
  • 相关阅读:
    11
    TSP-test
    TSP-SA_TSP
    TSP-PathLength
    TSP-OutputPath
    TSP-NewAnswer
    TSP-
    TSp-dsxy2figxy
    TSP-DrawPath
    TSP-Distanse
  • 原文地址:https://www.cnblogs.com/Yirannnnnn/p/4846364.html
Copyright © 2011-2022 走看看