( if steatmetn), even if the value is null when I click the button it delete the items

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.


here is the picture https://i.stack.imgur.com/0Pm5K.png

>Solution :

You need to remove comparison with null, I mean next:

} else {
   alert('Put a value');

Leave a Reply