File tree Expand file tree Collapse file tree 1 file changed +5
-6
lines changed
Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -30,12 +30,11 @@ const check = document.getElementById("check");
3030//via Book function and start render function
3131function submit ( ) {
3232 //if any of the information is missing show an alert
33- if (
34- title . value == null || // == checks both null and undefined . === only null
35- title . value == "" || // why you use the way and where author check??
36- pages . value == null || // if(!title.value||author.value|| page.value) is more clear and readable
37- pages . value == ""
38- )
33+ if ( ! title . value || ! author . value || ! pages . value )
34+ // == checks both null and undefined . === only null
35+ // why you use this way and where author check??
36+ // if(!title.value||author.value|| page.value) is more clear and readable
37+
3938 {
4039 alert ( "Please fill all fields!" ) ; // alert is a built-in JS function
4140 return false ;
You can’t perform that action at this time.
0 commit comments