Skip to content
Advertisement

Trying to validate email endings in javascript

Question: I am trying to validate email endings in an array

JavaScript

I can get this to work when validEndings is just a singular string e.g let validEndings = '@gmail.com' but not when its in an array comparing multiple things

Advertisement

Answer

You can solve the problem with regex. Example:

JavaScript
User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement