<html>
<head>
<title>Beast Mode ON</title>
<style>
</style>
</head>
<body>
<script type = "text/javascript">
var name = prompt("Please enter your name: ");
if (name == null || name == "") name = " visitor "
{document.write("Hi " + name + " welcome to javascript.");}
</script>
</body>
</html>
this code works accurately. the question i wanna raise is WHY? because the "if" statement executes the codes in curly braces only if the condition in the paretheses is met. but if i try to incorporate parentheses like
if ((name == null || name == "") name = " visitor ")
the code stops working. what's the reason?