How and What prototype maked difference in javaScript classes?

How and What prototype maked difference in javaScript classes?

Hi,
I have written class "IC" in a javaScript file whose code is like this:
 
  1. IC = function () {

  2. this.var1 = null;
  3. this.var2 = null;
  4. this.name = 'acxs-334';
  5. this.turn = 'forward';
  6. }
  7. IC.prototype.getMonthsName = function (m) {
  8. return IC.MonthsName[m];
  9. }
  10.  
  11. IC.MonthsName = ["Jan", "Feb", "Mar", "Apr"];
    Next I have written this code but I am getting this error while accessing MonthsName : 'MonthsName.0' is null or not an object
    function Person(gender) {
    debugger;
    var obj = new IC();
    var month = obj.getMonthsName(2);
    var month1 = obj.MonthsName[0]; //error coming
    }
     
    $(document).ready(function () {
    var p = new Person();
    });








    Can anyone tell where is the mistake?