Reputation: 2034
I'm using Underscore.js library to check for email address string inside my collection, if exists, like this:
var emailExists = this.model.get('emailmailCollection').where( {emailAddress:emailAddressValue});
It works perfectly for strings like [email protected], etc. but when I match emails like [email protected] & [email protected], it doesn't show it exists.
Is there a way to test for emails with case-insensitive in place.
Upvotes: 1
Views: 127
Reputation: 446
Wherever you are getting [email protected], use the .toLowerCase()
method on it and on your input. This way, all of your data is all lowercase.
For example:
console.log("Hello WOrLD".toLowerCase())
returns
hello world
this is a really amateurish way and probably won't work for you, but that's what I would try.
Upvotes: 0