0
what does the expression in brackets if(!task) mean?
const task = input.value; if(!task) { alert('Please, fill out the task'); return; }
1 ответ
+ 1
Here input.value is nothing but u r trying to give a input
Now coming to if statement !task=not task
means here the value which you are giving is stored in that task variable i.e task contains input value if the user does not enter any value then that task does not contain any value now this we write it as !task which means if the user does not enter a value then we will represent as !task and when the condition is true then alert function is called.