Is there a way to pass case sensitivity together with an argument?
var user = {
'name' : 'Jim',
'lastName' : 'Xydas',
'fullName' : function(){
return this.name + " " + this.lastName
},
'address' : {
'country' : "Greece",
'town' : "Thessaloniki",
'street' : "il.ap 15",
"isFromTown" : function(n){
return this.town == n ? true : false;
}
}
};
var checkUser = user.address.isFromTown("thessaloniki");
console.log(checkUser);
What I'm trying to do here is pass the argument as "thessaloniki" and print true, ignoring the first (or more) uppercase letter(s).
https://jsfiddle.net/DimitriXd4/mfpat7so/
Thanks in advance.