I don't have a database to compare the input values with.
Is there a way to validate user input against predetermined constants?
How can I redirect users only if their input matches one of the predefined constants?
Here is the JavaScript code snippet:
console.log('Welcome to the console');
var userInput = window.prompt ("Enter your username");
const usernames = ['Lorenzo', 'Angelo', 'David'];
console.log(usernames.includes(userInput));
if (usernames.includes(userInput)){
alert('Welcome back ' + userInput + ', click ok to enter the site');
} else {
alert('Incorrect username entered');
}