美文网首页微信小程序
微信小程序数据类型,for循环

微信小程序数据类型,for循环

作者: 若风_412d | 来源:发表于2019-11-26 10:45 被阅读0次

    数据类型转换

    string - int
    var day = parseInt(120900 / (1000 * 60));
    int- string
    var days = day.toString();

    https://blog.csdn.net/shanshan_1117/article/details/89371296

    二。数据使用

    https://www.jianshu.com/p/185efaea230c

    数组复制

        let arr = [];
        arr[0] = "a";
        arr[3] = "b";
    
        this.data.listLoad = arr.slice();
    
    

    数组遍历

        let arr = [];
        arr[0] = "a";
        arr[3] = "b";
        arr[10] = "c";
        arr[6] = "Hello world";
        arr.forEach((data, index, array) => {
          console.log(data, index);
        });
    
    

    数组删除元素

        let arr = [];
        arr[0] = "a";
        arr[1] = "b";
        arr[2] = "c";
        arr[3] = "Hello world";
        arr.splice(1, 2)//删除下标为1的2个数
        console.log('-=-=-=-=-=-=='+arr);
    

    相关文章

      网友评论

        本文标题:微信小程序数据类型,for循环

        本文链接:https://www.haomeiwen.com/subject/mekewctx.html