Javascript 无法使用delete删除数组索引/项

Javascript 无法使用delete删除数组索引/项,javascript,ecmascript-6,Javascript,Ecmascript 6,我正在使用delete尝试删除数组中的项目 const handleRowDeletion = index => { const inputsAdded = shareStructureInputs; const inputs = startupFourthStepForm.shares_estructure; delete inputs[index]; delete inputsAdded[index]; } 我可以看到第一个数组inputsAdded

我正在使用
delete
尝试删除数组中的项目

const handleRowDeletion = index => {
    const inputsAdded = shareStructureInputs;
    const inputs = startupFourthStepForm.shares_estructure;

    delete inputs[index];
    delete inputsAdded[index];
}
我可以看到第一个数组
inputsAdded
在适当的索引处被删除,但第二个数组
inputsAdded
没有删除

这是
inputsAdded
返回的内容:

[
  "share-structure-input-0",
  "share-structure-input-1",
  "share-structure-input-2"
]
输入

[
  {
    "name": "Name 1",
    "percentage": 10
  },
  {
    "name": "Name 2",
    "percentage": 10
  },
  {
    "name": "Name 3",
    "percentage": 80
  }
]
我在
map

                <Button onClick={() => handleRowDeletion(index)}>
                  - Delete Row
                </Button>
handlerowdelection(索引)}>
-删除行

是否
delete
仅用于对象?您没有在任何对象属性上使用
delete
,这里有一个更好的副本可以准确回答您的问题,不是
delete
仅用于对象吗?您没有在任何对象属性上使用
delete
,这里有一个更好的副本,可以准确回答您的问题,