Storing statistics as JSON in a simulation game I am working on a choice-based simulation and players have to choose between different locations, I am pushing those choices to an array locationLog and my MakeStats() function below builds an array from it. I tend to break code into bits because it helps me, but want to make sure others can understand it.

var hasAttorney = false;
var hasMoney = true;
var hasAC = true;
var currentlocation = "home";
var locationLog = []; //push locations

//Builds a JSON object with game stats
function MakeStats() {
    let home = 0,
        motel = 0,
        relative = 0,
        shelter = 0,
        apartment = 0;

    for (var i = 0; i &lt; locationLog.length; i++) {
        if (locationLog[i] === "home")
            home++;
        else if (locationLog[i] === "motel")
            motel++;
        else if (locationLog[i] === "relative")
            relative++;
        else if (locationLog[i] === "shelter")
            shelter++;
        else if (locationLog[i] === "apartment")
            apartment++;
    }

    let tempJSON = {
        "location": {
            "home": home,
            "motel": motel,
            "relative": relative,
            "shelter": shelter,
            "apartment": apartment
        },
        "moneyLeft": money,
        "ACLeft": AC,
        "finalDestination": currentlocation,
        "hasAttorney": hasAttorney,
        "hasAC": hasAC,
        "hasMoney": hasMoney
    };
    statJSON = tempJSON;
    localStorage.setItem("playerStats", JSON.stringify(statJSON));
    console.log(statJSON);
}
Some extra points that Sam Onᴇᴌᴀ's good review skipped.

Capitalizing function names

Don't capitalize functions if they are not used to create an object. In JavaScript we only capitalize functions or objects that can be instantiated with the new token. Thus MakeStats should be makeStats.

However if you were to return the object statJSON then you could use the name MakeStats to indicate that it instantiates an object. You can then create the object in 3 ways, each of which return the same object.

    // last 2 lines of MakeStats to be
    return statJSON;
}

const s1 = new MakeStats();
const s2 = new MakeStats;  // with new objects () is not needed if there are no arguments
const s3 = MakeStats();


Quoted property names

I see this a lot, when people create an object that is to be stringified. For some reason  quoted property names are used. Doing so is just adding unneeded noise to the code. 

The only time you need to use quotes to define a property is if the property is not a valid javascript variable name. e.g.  {data-one: "one"} will throw an error as data-one is not a valid name, you would thus write it {"data-one": "one"} 

Shorthand property names (ES2015)

Use object property shorthand if you are adding existing named variables to an object.

You have

let tempJSON = {
    "location": {
        "home": home,
        "motel": motel,
        "relative": relative,
        "shelter": shelter,
        "apartment": apartment
    },
    "moneyLeft": money,
    "ACLeft": AC,
    "finalDestination": currentlocation,
    "hasAttorney": hasAttorney,
    "hasAC": hasAC,
    "hasMoney": hasMoney
};


can be written as

const tempJSON = {
    location: {home, motel, relative, shelter, apartment},
    moneyLeft: money,
    ACLeft: AC,
    finalDestination: currentlocation,
    hasAttorney, 
    hasAC,
    hasMoney
};


the resulting object is identical to the longhand version.

localStorage

You can use simpler notation when accessing localStorage.

You have 

localStorage.setItem("playerStats", JSON.stringify(statJSON));


is identical to 

localStorage.playerStats = JSON.stringify(statJSON);


The same applies to reading from localStorage

stats = localStorage.playerStats; // Note If that data is not there you get undefined
                                  // Note All data from local storage is a string


Don't trust localStorage

There is no way to guarantee that localStorage content written in one session will be available next time, nor can you trust the data you read back, and many 3rd party extensions have full access to localStorage. 

If the data is important, requires trust, or contains personal client data it should be saved on the server.

Warning about cyclic data

JSON.stringify will throw a TypeError: "Converting circular structure to JSON" if the data contains cyclic references. 

Cyclic references are everywhere in JavaScript so if you are stringifying data from unknown or unsure sources is pays to wrap the stringify in a try catch so at least you can recover gracefully. As your function is using data from outside its control it would pay to be safe (unless you are in full control of all data).