Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to change prompt input to upper or lower case in JS? #603

Closed
Rupanwita opened this issue Feb 13, 2021 · 1 comment
Closed

How to change prompt input to upper or lower case in JS? #603

Rupanwita opened this issue Feb 13, 2021 · 1 comment

Comments

@Rupanwita
Copy link

I created an array called guestList and the first letter of each name is in uppercase. However, when in the prompt, I am typing the same name but all letters in lower case, I'm not getting the desired results as given in the code, despite changing the guest variable to (.toLowerCase();) .. how to fix it?

var guestList = ["Jack", "Jay", "Jim", "John", "Joseph"];
alert("HEL0000, thanks for dropping by. Click 'OKAY' to check if you're on the invite list!");
var guest = prompt("Enter your name here");
guest.toLowerCase();
if (guestList.includes(guest)) {
alert("Welcome to the party!! 14 Feb, 8PM, sharp");
}
else {
alert("Sorry, may be next time!")
}

@tshirtman
Copy link
Member

This seem to have nothing to do with this project, this is not a general help support, please only open an issue here if you have an issue with the plyer library.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants