Q:

Dynamically selecting specific object and key value to iterate over, doc.write to div

I'm a Teamtreehouse-educated newbie trying to create (what I thought) was a simple JavaScript function that, after parsing the URL to pull down and create a variable from a necessary string in the URL, I would then use that identifier to create a dynamically updating script which would, in this case, deliver a college football team's schedule (date of game and opponent) to a div in the HTML.
For instance "/teams/fsu.html" would be parsed to "fsu" and "html", and I'd then take the string "fsu" to ensure my functions "know" which page their on and thus which objects/arrays/etc. to deliver. I'm able to concatenate the date and game for each, but I cannot actually get them properly to the page. Here's a sample my of code:
// This objects contains each game day of each week of the college football season.

var gameDays = {
week1: ["Thursday, August 28th",
"Friday, August 29th",
"Saturday, August 30th",
"Sunday, August 31st",
"Monday, September 1st"],
week2: ["Thursday, September 4th",
"Friday, September 5th",
"Saturday, September 6th"],
week3: ["Thursday, September 11th",
"Friday, September 12th",
"Saturday, September 13th",
"Sunday, September 14th"],
week4: ["Thursday, September 18th",
"Friday, September 19th",
"Saturday, September 20th"],
week5: ["Thursday, September 25th",
"Friday, September 26th",
"Saturday, September 27th"],
week6: ["Thursday, October 2nd",
"Friday, October 3rd",
"Saturday, October 4th"],
week7: ["Thursday, October 9th",
"Friday, October 10th",
"Saturday, October 11th",
"Sunday, October 12th"],
week8: ["Tuesday, October 14th",
"Thursday, October 16th",
"Friday, October 17th",
"Saturday, October 18th"],
week9: ["Tuesday, October 21st",
"Thursday, October 23rd",
"Friday, October 24th",
"Saturday, October 25th",
"Sunday, October 26th"],
week10: ["Thursday, October 30th",
"Friday, October 31st",
"Saturday, November 1st"],
week11: ["Tuesday, November 4th",
"Wednesday, November 5th",
"Thursday, November 6th",
"Friday, November 7th",
"Saturday, November 8th"],
week12: ["Tuesday, November 11th",
"Wednesday, November 12th",
"Thursday, November 13th",
"Friday, November 14th",
"Saturday, November 15th"],
week13: ["Tuesday, November 18th",
"Wednesday, November 19th",
"Thursday, November 20th",
"Friday, November 21st",
"Saturday, November 22nd",
"Sunday, November 23rd"],
week14: ["Tuesday, November 25th",
"Thursday, November 27th",
"Friday, November 28th",
"Saturday, November 29th"],
week15: ["Thursday, December 4th",
"Saturday, December 6th"],
week16: ["Saturday, December 13th"]
}

// I've created objects for each Top 25 team, but here's just three for this example

// #1:

var fsu = {
    conf: "ACC",
    sched: 
        [gameDays.week1[2] + " vs Oklahoma State",
        gameDays.week2[2] + " vs Citadel",
        gameDays.week4[2] + " vs #16 Clemson",
        gameDays.week5[2] + " at North Carolina State",
        gameDays.week6[2] + " vs Wake Forest",
        gameDays.week7[2] + " at Syracuse",
        gameDays.week8[3] + " vs #17 Notre Dame",
        gameDays.week10[0] + " at Louisville",
        gameDays.week11[4] + " vs Virginia",
        gameDays.week12[4] + " at Miami",
        gameDays.week13[4] + " vs Boston College",
        gameDays.week14[3] + " vs Florida"]
}

// #2:

var bama = {
    conf: "SEC",
    sched: 
        [gameDays.week1[2] + " vs West Virginia",
        gameDays.week2[2] + " vs Florida International",
        gameDays.week3[2] + " vs Southern Mississippi",
        gameDays.week4[2] + " vs Florida",
        gameDays.week6[2] + " @ #18 Ole Miss",
        gameDays.week7[2] + " at Arkansas",
        gameDays.week8[3] + " vs #21 Texas A&M",
        gameDays.week9[3] + " at Tennessee",
        gameDays.week11[4] + " @ #13 LSU",
        gameDays.week12[4] + " vs Mississippi State",
        gameDays.week13[4] + " vs Western Carolina",
        gameDays.week14[3] + " vs #6 Auburn"]
}

// #3:

var oregon = {
    conf: "PAC12",
    sched: 
        [gameDays.week1[2] + " vs South Dakota",
        gameDays.week2[2] + " vs #8 Michigan State",
        gameDays.week3[2] + " vs Wyoming",
        gameDays.week4[2] + " at Washington State",
        gameDays.week6[0] + " vs Arizona",
        gameDays.week7[2] + " at #7 UCLA",
        gameDays.week8[3] + " vs #25 Washington",
        gameDays.week9[2] + " at California",
        gameDays.week10[2] + " vs #11 Stanford",
        gameDays.week11[4] + " at Utah",
        gameDays.week13[4] + " vs Colorado",
        gameDays.week14[3] + " at Oregon State"]
}

// And here's the the JS I'm using to try and bring each schedule to the page:

// This parses the URL and grabs the proper identifier for me, i.e. "fsu"

function parseURL() {
  var match = window.location.href.match(/(\w+).html$/);
  if (match) {
    return match[1];
  }
  return null;
}

// This is what I was _hoping_ would create the proper variable to call for the needed
// object and key value, for instance, "fsu.sched", which would then return their schedule:

var teamSched = parseURL() + ".sched";

// This is the scripting I was then using as a test to simply get "teamSched" 
// value to the page.

function testParse() {
    document.getElementById('scheduleText').innerHTML;
    document.write(teamSched);
}

// And this script ties it all together and executes it.

var team = parseURL();
if (teamSched) {
  testParse(teamSched);
}

So what I'm getting in the output in the HTML is just the string of text "fsu.sched", not the actually object key values for "fsu.sched".
I'm thinking that I've screwed up by not using "this" statements for objects, but I thought that, as a novice obviously, with each variable visible in the JS file, it'd make it clear for me to write code around it all.
I would sincerely appreciate any help and insight you can provide this incredibly stumped rookie!

A:

What you had originally was creating a String that you wanted to use as a variable.
The code you have will work pretty much as-is if you wrap your team data in an object the same way you did with gameDays. So for example with fsu:
teams = {
            fsu : {
                conf: "ACC",
                sched: 
                [gameDays.week1[2] + " vs Oklahoma State",
                gameDays.week2[2] + " vs Citadel",
                gameDays.week4[2] + " vs #16 Clemson",
                gameDays.week5[2] + " at North Carolina State",
                gameDays.week6[2] + " vs Wake Forest",
                gameDays.week7[2] + " at Syracuse",
                gameDays.week8[3] + " vs #17 Notre Dame",
                gameDays.week10[0] + " at Louisville",
                gameDays.week11[4] + " vs Virginia",
                gameDays.week12[4] + " at Miami",
                gameDays.week13[4] + " vs Boston College",
                gameDays.week14[3] + " vs Florida"]
            },
            bama : {
                conf: "SEC",
                sched: 
                [gameDays.week1[2] + " vs West Virginia",
                gameDays.week2[2] + " vs Florida International",
                gameDays.week3[2] + " vs Southern Mississippi",
                gameDays.week4[2] + " vs Florida",
                gameDays.week6[2] + " @ #18 Ole Miss",
                gameDays.week7[2] + " at Arkansas",
                gameDays.week8[3] + " vs #21 Texas A&M",
                gameDays.week9[3] + " at Tennessee",
                gameDays.week11[4] + " @ #13 LSU",
                gameDays.week12[4] + " vs Mississippi State",
                gameDays.week13[4] + " vs Western Carolina",
                gameDays.week14[3] + " vs #6 Auburn"]
            }
        }

And then in your logic, initialize teamSched to just the team name in the teams Object:
var teamSched = parseURL();

And in testParse, change your document.write line to:
document.write(teams[teamSched].sched);

