📌  相关文章
📜  我们如何将数组的索引作为 ID 提供给元素 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:02:42.705000             🧑  作者: Mango

代码示例1
//Here the delete button gets a unique ID everytime, the ID is the array index of the element. 
array.forEach(function (element, index) {
      display =
        display +
        `
            ${index + 1}
            ${element.first}
            ${element.second}
            ${element.third}
            
        `;
    });