Creating an html table to display data from JSON Object
<p>I am creating a website where I call a function that will generate a html table using data from the JSON object. It's my first time trying to do it. I can't get the function to execute. I have tested whether the function starts, but it doesn't. </p>

<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-js lang-js prettyprint-override"><code>var alum = { "students2015" : [
    { "firstName" : "Zeynep", "lastName" : "Abalioglu", "university" : "Boston University" } +
                { "firstName" : "Ata", "lastName" : "Aganoglu", "university" : "University of Exeter" } +
                { "firstName" : "Ege", "lastName" : "Agca", "university" : "Universita Bocconi" } +
                { "firstName" : "Doruk", "lastName" : "Akdas", "university" : "York University" } +
                { "firstName" : "Batuhan", "lastName" : "Aksin", "university" : "University of Exeter" } +
                { "firstName" : "Omer Alp", "lastName" : "Aksu", "university" : "The University of Texas at San Antonio" } +
                { "firstName" : "Yosun", "lastName" : "Asal", "university" : "University of The Arts London - Central Saint Martins" } +
                { "firstName" : "Yasemin", "lastName" : "Avci", "university" : "Northeastern University" } +
                { "firstName" : "Yekta", "lastName" : "Baki", "university" : "University of Sheffield" } +
                { "firstName" : "Anil", "lastName" : "Bakkaloglu", "university" : "Lehigh University" } +
                { "firstName" : "Arda", "lastName" : "Budin", "university" : "Ryerson University" } +
                { "firstName" : "Berke", "lastName" : "Cavusoglu", "university" : "HZ University of Applied Science" } +
                { "firstName" : "Sena", "lastName" : "Cetindere", "university" : "University of Bristol" } +
                { "firstName" : "Dilge", "lastName" : "Dilsiz", "university" : "Lafayette College" } +
                { "firstName" : "Kerem", "lastName" : "Dogurga", "university" : "Emily Carr University Art and Design" } +
                { "firstName" : "Alp", "lastName" : "Erselcan", "university" : "Semmelweis University" } +
                { "firstName" : "Bora", "lastName" : "Guloglu", "university" : "University of Oxford" } +
                { "firstName" : "Ilayda", "lastName" : "Gunduz", "university" : "University of Toronto" } +
                { "firstName" : "Derin", "lastName" : "Guzel", "university" : "University of Pennsylvania" } +
                { "firstName" : "Rena", "lastName" : "Hazan", "university" : "Boston University" } +
                { "firstName" : "Joel", "lastName" : "Hemsi", "university" : "Brandeis University" } +
                { "firstName" : "Begum", "lastName" : "Inal", "university" : "University of California, Santa Cruz" } +
                { "firstName" : "Sude", "lastName" : "Karadinc", "university" : "King\'s College London" } +
                { "firstName" : "Murat Can", "lastName" : "Kaya", "university" : "Pennsylvania State University" } +
                { "firstName" : "Goksu", "lastName" : "Kayaalp", "university" : "Univresita Cattolica Del Sacro Cuore" } +
                { "firstName" : "Defne", "lastName" : "Kaynak", "university" : "School of The Art Institute of Chicago" } +
                { "firstName" : "Nursima", "lastName" : "Kazanci", "university" : "City University(F)" } +
                { "firstName" : "Ozan", "lastName" : "Kokuludag", "university" : "Erasmus Universiteit Rotterdam" } +
                { "firstName" : "Ozge", "lastName" : "Mentes", "university" : "University of Bath" } +
                { "firstName" : "Gokhan", "lastName" : "Mungan", "university" : "University of California, Davis" } +
                { "firstName" : "Kutay", "lastName" : "Nazli", "university" : "Pomona College" } +
                { "firstName" : "Berfin", "lastName" : "Necimoglu", "university" : "Sciences Po" } +
                { "firstName" : "Sarp", "lastName" : "Oktay", "university" : "University of Exeter" } +
                { "firstName" : "Irmak", "lastName" : "Ozbek", "university" : "Universita Cattolica Del Sacro Cuore" } +
                { "firstName" : "Serra", "lastName" : "Ozdemir", "university" : "Pratt Institute" } +
                { "firstName" : "Berk", "lastName" : "Ozture", "university" : "University of Bristol" } +
                { "firstName" : "Ella", "lastName" : "Polat", "university" : "Royal Holloway, University of London" } +
                { "firstName" : "Efe", "lastName" : "Saatci", "university" : "Northwestern University" } +
                { "firstName" : "Deniz", "lastName" : "Sutas", "university" : "University of Guelph" } +
                { "firstName" : "Mustafa", "lastName" : "Tuntas", "university" : "Universita Bocconi" } +
                { "firstName" : "Serra", "lastName" : "Turkun", "university" : "Parsons The School For Design" } +
                { "firstName" : "Elif", "lastName" : "Ulusan", "university" : "Boston University" } +
                { "firstName" : "Sueda", "lastName" : "Yurdadonen", "university" : "Karlsruhe Institute of Technology" }],
            "students2014" : [
        { "firstName" : "Melis", "lastName" : "Uysal", "university" : "King's College London"} +
                { "firstName" : "Melisa", "lastName" : "Ozen", "university" : "Columbia University"} +
                { "firstName" : "Emre", "lastName" : "Pehlivan", "university" : "Goethe Institut"} +
                { "firstName" : "Ali", "lastName" : "Tankurt", "university" : "University of British Columbia"} +
                { "firstName" : "Kemal", "lastName" : "Gozegir", "university" : "Royal Holoway, University of London"} +
                { "firstName" : "Arda", "lastName" : "Gulyapan", "university" : "University of Surrey"} +
                { "firstName" : "Dogan", "lastName" : "Akad", "university" : "University of Toronto"} +
                { "firstName" : "Ceren", "lastName" : "Korkut", "university" : "Bocconi University"} +
                { "firstName" : "Ahmet Emre", "lastName" : "Harsa", "university" : "Dalhousie University"} +
                { "firstName" : "Melodi Var", "lastName" : "Ongel", "university" : "Bennington College"} +
                { "firstName" : "Basak", "lastName" : "Unligil", "university" : "University of Wisconsin, Milwakee"} +
                { "firstName" : "Deniz", "lastName" : "Dokuzer", "university" : "Otis College of Art and Design"} +
                { "firstName" : "Ada", "lastName" : "Dogrucu", "university" : "Worcester Polytechnic Institute"} +
                { "firstName" : "Ahmet Uzay", "lastName" : "Sezer", "university" : "Syracuse University"} +
                { "firstName" : "Selim", "lastName" : "Unsal", "university" : "University of Exeter"} +
                { "firstName" : "Alara", "lastName" : "Kaynar", "university" : "University of Toronto"} +
                { "firstName" : "Ayse", "lastName" : "Devecioglu", "university" : "Royal Holloway, University of London"} +
                { "firstName" : "Emir", "lastName" : "Vurgun", "university" : "University of Exeter"} +
                { "firstName" : "Ismet", "lastName" : "Genelioglu", "university" : "Royal Holloway, University of London"} +
                { "firstName" : "Merve", "lastName" : "Yolcu", "university" : "Bentley University"} +
                { "firstName" : "Zeynep", "lastName" : "Yeniceri", "university" : "Bocconi University"} +
                { "firstName" : "Lidya", "lastName" : "Yengul", "university" : "Brandenburg University of Technology, Cottbus"} +
                { "firstName" : "Timucin", "lastName" : "Oztepe", "university" : "City University"} +
                { "firstName" : "Alp Eren", "lastName" : "Elci", "university" : "Northeastern University"} +
                { "firstName" : "Ceylin", "lastName" : "Kocagoz", "university" : "Emerson College"} +
                { "firstName" : "Caglar", "lastName" : "Ozkul", "university" : "University of Exeter"} +
                { "firstName" : "Eda", "lastName" : "Seyok", "university" : "University of Edinburg"} +
                { "firstName" : "Ismail", "lastName" : "Tiryaki", "university" : "University of Exeter"} +
                { "firstName" : "Ogul Dogukan", "lastName" : "Ozen", "university" : "Politecnico di Milano"} +
                { "firstName" : "Emily Su", "lastName" : "Akdogan", "university" : "University College Utrecht"} +
                { "firstName" : "Deniz", "lastName" : "Amado", "university" : "Brandeis University"} +
                { "firstName" : "Selen", "lastName" : "Amado", "university" : "Brandeis University"} +
                { "firstName" : "Ece", "lastName" : "Ates", "university" : "Sarah Lawrence College"} +
                { "firstName" : "Defne", "lastName" : "Erdinc", "university" : "Barnard College"} +
                { "firstName" : "Yasemin", "lastName" : "Erdinc", "university" : "Barnard College"} +
                { "firstName" : "Esra", "lastName" : "Koraltan", "university" : "Queen Mary, University of London"} +
                { "firstName" : "Tuna", "lastName" : "Kunt", "university" : "University College London"} +
                { "firstName" : "Leyla", "lastName" : "Kursat", "university" : "Tufts University"} +
                { "firstName" : "Anna Maria", "lastName" : "Masautova", "university" : "University of Bristol"} +
                { "firstName" : "Piril", "lastName" : "Ozgercin", "university" : "Science Po-Columbia Dual Program"} +
                { "firstName" : "Ester", "lastName" : "Saba", "university" : "University of the Arts London"} +
                { "firstName" : "Sevgi", "lastName" : "Secen", "university" : "European School of Economics"} +
                { "firstName" : "Deniz", "lastName" : "Sokullu", "university" : "Carnegie Mellon University"} +
                { "firstName" : "Kayra Sila", "lastName" : "Ozalp", "university" : "Hong Kong University of Science and Technology"} ],
           "students2013" : [
        { "firstName" : "Gunce Beren", "lastName" : "Agirbas", "university" : "Semmelweis University"} +
               { "firstName" : "Sandra", "lastName" : "Antebi", "university" : "Parsons School of Design"} +
               { "firstName" : "Ogulcan", "lastName" : "Baloglu", "university" : "University of Edinburgh"} +
               { "firstName" : "Emre", "lastName" : "Cubukcu", "university" : "University of Exeter"} +
               { "firstName" : "İpek", "lastName" : "Ertan", "university" : "McGill University"} +
               { "firstName" : "Elif", "lastName" : "Fotocan", "university" : "Pratt University"} +
               { "firstName" : "Nusret", "lastName" : "İpek", "university" : "Arizona State University"} +
               { "firstName" : "Mert", "lastName" : "Karakaya", "university" : "Purdue University"} +
               { "firstName" : "Zeynep", "lastName" : "Kaserci", "university" : "University of Saint Andrews"} +
               { "firstName" : "Cemrenaz", "lastName" : "Kuyumcu", "university" : "University of Bath"} +
               { "firstName" : "Serra Baysun", "lastName" : "Onder", "university" : "Worcester Polytechnic Institute"} +
               { "firstName" : "Bilgehan", "lastName" : "Saglik", "university" : "Wentworth Institute of Technology"} +
               { "firstName" : "Ilayda", "lastName" : "Susluer", "university" : "Michigan State University"} +
               { "firstName" : "Anita", "lastName" : "Savul", "university" : "Parsons School of Design"} +
               { "firstName" : "Doruk", "lastName" : "Tort", "university" : "University of Surrey"} +
               { "firstName" : "Gulce", "lastName" : "Tulcali", "university" : "Universita Bocconi"} +
               { "firstName" : "Cansu", "lastName" : "Ulcay", "university" : "McGill University"} +
               { "firstName" : "Ali Berkay", "lastName" : "Yaranolu", "university" : "University of Surrey"} +
               { "firstName" : "Ece", "lastName" : "Zengin", "university" : "Rhode Island School of Design"}]};

function yearCheck(year) {
    "use strict";
    year
    var container = document.getElementById("table"),
        table = document.createElement("TABLE"),
        row,
        i,
        j,
        tData,
        tRow;
    
    switch (year) {
    case 2013:
        for (i = 0; i &lt; alum.students2013.length; i += 1) {
            tRow = table.createElement("TR");
            for (j = 0; j &lt; 3; j += 1) {
                tData = table.createElement("TD");
                switch (j) {
                case 0:
                    tData = alum.students2013[i].firstName;
                    tRow.appendChild(tData);
                    table.appendChild(tRow);
                    break;
                case 1:
                    tData = alum.students2013[i].lastName;
                    tRow.appendChild(tData);
                    table.appendChild(tRow);
                    break;
                case 2:
                    tData = alum.students2013[i].university;
                    tRow.appendChild(tData);
                    table.appendChild(tRow);
                    break;
                }
            }
        }
        container.appendChild(table);
        break;
    case 2014:
        break;
    case 2015:
        break;
    case 2016:
        break;
    default:
        break;
    }
}</code></pre>
<pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;body&gt;
        &lt;div class="container" id="table"&gt;
            &lt;script&gt;document.getElementById("table").innerHTML = yearCheck(2013);&lt;/script&gt;
        &lt;/div&gt;
&lt;/body&gt;</code></pre>
</div>
</div>
</p>

<p>I have added how I called the function in the  tag. I have tried to to call the function by using the attribute onload="". After testing I figured that it didn't even start the function. Is it because of the parameter in the function call? Thanks for the help in advance.</p>