• Javascript的console.log()用法


    //变量
    var i = 'I am a string';
    console.log('变量:',i);

    //数组
    var arr = [1,2,3,4,5];
    console.log('数组:',arr);

    //对象
    var obj1 = {
    key1 : 'value1',
    key2 : 'value2',
    key3 : 'value3'
    };
    var obj2 = {
    key6 : 'value4',
    key5 : 'value5',
    key4 : 'value6'
    };
    var obj3 = {
    key9 : 'value7',
    key8 : 'value8',
    key7 : 'value9'
    };

    console.log('对象:',obj1);
    //对象数组
    var objArr1 = [obj1,obj2,obj3];
    var objArr2 = [[obj1],[obj2],[obj3]];

    console.log('对象数组1:',objArr1);
    console.log('对象数组1:',objArr2);

     

    /*
    输出:
    变量:I am a string
    数组:[1, 2, 3, 4, 5]
    对象:Object { key1="value1", key2="value2", key3="value3"}
    对象数组1:[Object { key1="value1", key2="value2", key3="value3"}, Object { key6="value4", key5="value5", key4="value6"}, Object { key9="value7", key8="value8", key7="value9"}]
    对象数组1:[[Object { key1="value1", key2="value2", key3="value3"}], [Object { key6="value4", key5="value5", key4="value6"}], [Object { key9="value7", key8="value8", key7="value9"}]]
    */

  • 相关阅读:
    Requests爬虫
    1.3预处理与热图
    1.2为多变量数据绘制散点阵图
    urllib爬虫(流程+案例)
    1.1用图表分析单变量数据
    tkinter python(图形开发界面)
    mysql及python交互
    正则表达式
    python--map()、reduce()
    python--__init__()方法和__new__()方法
  • 原文地址:https://www.cnblogs.com/joe235/p/2964562.html
Copyright © 2020-2023  润新知