JSFiddle - React, Tailwind, and code Playground
HTML
<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
<meta charset="utf-8">
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<title>Check spy</title>
</head>
<body>
<h1>Welcome to Part 9: Your JavaScript Level One Project!</h1>
<p>For this project you will be building a generic website that will seem to ask mundane
questions to normal users, but you secretly are looking for a spy! Anyone visiting your website will be asked a series of questions,
only the Spy will be able to give specific answers you expect. If all question are answered correctly, you will posta secret message in console for the Spy to read!</p>
<script src="checking_spy.js" ></script>
</body>
</html>
JavaScript
alert("Hello! I will ask you some question?");
var firstName = prompt("What is your First Name?");
var lastName = prompt("What is your Last Name?");
var age = prompt("How old are you?");
var tall = prompt("How tall are you in centimeters");
var petName = prompt("What is your pet name?");
if(firstName[0] == lastName[0] && (20 <= age && age <=30) && petName[petName.length-1] == "y"){
console.log("Welcome Comrade! You've passed the Spy Test");
}
else{
console.log("Sorry, nothing to see here.");
}