If-3

 

if the variable book is "maths" then it will print as "Maths Book",  following condition will execute

else if( book == "maths" ){ document.write("Maths Book"); } 


 
 
 
<!DOCTYPE html> <html> <head> <title>Welcome to LearnKode - A code learning platform</title> </head> <body> <script> var book = "maths"; if( book == "history" ){ document.write("<b>History Book</b>"); } else if( book == "maths" ){ document.write("<b>Maths Book</b>"); } else if( book == "economics" ){ document.write("<b>Economics Book</b>"); } else{ document.write("<b>Unknown Book</b>"); } </script> </body> </html>
Output