How do I get Javascript to be not case sensitive when it comes to if statements?
===

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. 


    function search(name) {
    var ourContacts = contacts.length;
    for (var i = 0; i < ourContacts; i++) {
    if (contacts[i].name === name) {
    printdog(contacts[i]);
    }
    }
    }
Here is my whole script if you need it for better understandings.

    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 < ourContacts; i++) {
    printdog(contacts[i]);
    }
    }
    list();
    function search(name) {
    var ourContacts = contacts.length;
    for (var i = 0; i < ourContacts; i++) {
    name = name.toLowerCase;
    if (contacts[i].name === name) {
    printdog(contacts[i]);
    }
    }
    }

    <button onclick="search(prompt('Search Dogs Name'))">Search for Dog</button>