//代码1
let jsonstr = '{"ids":[0,1,2,3,4,5,6,7,8,9]}';
let test1 : number[] = (JSON.parse(jsonstr) as UTSJSONObject)['ids'] as number[];
let a = test1.indexOf(0);
console.log(a);
//代码2
let test2 :number [] = [0,1,2,3,4,5,6,7,8,9];
let b = test2.indexOf(0);
console.log(b);
请问下代码1的写法是否错误的?这两个代码在版本4.44执行结果为什么不一样啊?
以前版本可以正常使用!
0 个回复