How do I get Javascript to be not case sensitive when it comes to if statements?
<p>I fully understand Javascript is case sensitive, but when it comes to if statements Sam does not equal to sam. I created a prompt box calling this function and I would like it to convert sam to Sam or make both True when you type the name into the prompt box. </p>

<pre><code>function search(name) {
var ourContacts = contacts.length;
for (var i = 0; i &lt; ourContacts; i++) {
if (contacts[i].name === name) {
printdog(contacts[i]);
}
}
}
</code></pre>

<p>Here is my whole script if you need it for better understandings.</p>

<pre><code>function dog(name, breed, age, color, weight, owner, owneraddress) {
    this.name = name;
    this.breed = breed;
    this.age = age;
    this.color = color;
    this.weight = weight;
    this.owner = owner;
    this.owneraddress = owneraddress;
}
//My Dogs
var sam = {
    name: "Sam",
    breed: "Chihuahua",
    age: 7,
    color: "White",
    weight: "7 lb",
    owner: "Bourton",
    owneraddress: "44 Berkley Drive"
};
var max = {
    name: "Max",
    breed: "Chihuahua",
    age: 4,
    color: "Brown",
    weight: "5 lb",
    owner: "Smith",
    owneraddress: "134 Door Ave"
};

//My array of dogs
var contacts = [sam, max];

function printdog(dog) {
    console.log(dog.name + " " + dog.owner);
}
function list() {
var ourContacts = contacts.length;
for (var i = 0; i &lt; ourContacts; i++) {
printdog(contacts[i]);
}
}
list();
function search(name) {
var ourContacts = contacts.length;
for (var i = 0; i &lt; ourContacts; i++) {
name = name.toLowerCase;
if (contacts[i].name === name) {
printdog(contacts[i]);
}
}
}

&lt;button onclick="search(prompt('Search Dogs Name'))"&gt;Search for Dog&lt;/button&gt;
</code></pre>
