in the if statement, even if the value is null, when I click the button, it is still deleting the item which is in the array. I would be happy if you guys help, I have no idea.
[1]:
here is the picture https://i.stack.imgur.com/0Pm5K.png
In first screenshot - you need to remove comparison with null, I mean next:
if(dele){
....
} else {
alert('Put a value');
}
Solution for the second screenshot:
function myfc2() {
let change = document.getElementById("den").value;
if(change){
liste[change] = document.getElementById("sen").value;
} else {
alert("Put a value");
}
document.getElementById("demo").innerHTML = liste;
}