Found and fixed my own error. The problem was that I've had another variable called "map" in a different document, so with that being around my code didn't work. I'll just leave this code here as an example of how to do a map.
<html>
<head>
<script type="text/javascript">
var map = {};
map["red"] = "not avaliable";
map["blue"] = "avaliable";
function car(color){
this.color = color;
}
function initialize(){
var testCar = new car("blue");
alert("Value is obviously blue: " + testCar.color);
if (testCar.color in map) {
var mappedValue = map[testCar.color];
console.log("Your car in "+ testCar.color + " is "+ mappedValue);
} else {
console.log("No color "+ testCar.color + "in maps");
}
}
</script>
</head>
<body onload="initialize()"></body>
</html>
Problem solved. Be careful you don't have variables with the same name even in different documents.