title: How to make a js code which allows user to view their page only if they satisfy the 'if' condition?
body: <p>This is the sample code:</p>
  
  <pre><code>var users = ["ownersName","Others"];
  var name=prompt("Enter your name");
  if(name==users[0]){
      w
      alert("Hey"+' '+name)
      alert("You have been granted the webMaster Role!")
  }
  else{
      console.log("hello user");
  }
  </code></pre>
  
  <p>I want to allow the user to view the page only if his name satisfies 'ownersName'.</p>