goodday 发表于 2025-6-2 11:44:34

这个程序中为什么delete tab.a; 会报错?

import console;

// 表属性删除示例
var tab = {a=1; b=2};
console.dump("删除前", tab);
console.dump(tab.a)
delete tab.a;
console.dump("删除后", tab);

// 数组元素删除示例
var arr = {1,2,3};
console.dump("删除前", arr);
delete arr;
console.dump("删除后", arr);

console.pause();



这个程序中为什么delete tab.a; 会报错?


15106970607 发表于 2025-6-3 17:26:23

删除数据 但tab索引长度不变使用tab.a = null
彻底删除 并重排索引 table.remove(arr,2)
页: [1]
查看完整版本: 这个程序中为什么delete tab.a; 会报错?