标签:object json log one dex john array tin code
//arrayObject.splice(index,howmany,item1,.....,itemX) 语法
//测试代码
let array;
array = [‘George‘,‘John‘,‘Thomas‘,‘James‘,‘Adrew‘,‘Martin‘];
cc.log(‘array = ‘ + jsonencode(array));
array.splice(1,0,‘gmk‘);
cc.log(‘array = ‘ + jsonencode(array));
array = [‘George‘,‘John‘,‘Thomas‘,‘James‘,‘Adrew‘,‘Martin‘];
cc.log(‘array = ‘ + jsonencode(array));
array.splice(1,1);
cc.log(‘array = ‘ + jsonencode(array));
//测试代码log
//array = ["George","John","Thomas","James","Adrew","Martin"]
//array = ["George","gmk","John","Thomas","James","Adrew","Martin"]
//array = ["George","John","Thomas","James","Adrew","Martin"]
//array = ["George","Thomas","James","Adrew","Martin"]
标签:object json log one dex john array tin code
原文地址:https://www.cnblogs.com/guomengkai/p/11357642.html