I keep getting cannot read property error












-2















I am trying to do a bubblesort. I am using this algorithm to sort a 2d array and I keep getting an error. Here is the function:



var array = [
[ "Rober Hill" , 123.54 ],
[ "Chrsitopher Reddkin", 54.67 ],
[ "Maggie Woods" , 1000.87 ],
[ "Jennifer Jones" , 3.34 ],
[ "Marcus Parker" , 64.98 ]
];
table = document.getElementById("table");

function bubbleSort(array, length, element)
{
var swapped = false;
do
{
for (var a = 0; a < 5; a++) // Line 59
{
if (array[a][1] > array[a+1][1])
{
var temp = array[a][1];
array[a][1] = array[a+1][1];
array[a+1][1] = temp;
swapped = true;
}
}
} while(swapped);

return array;

}


The error says: Sorting.html:59 Uncaught TypeError: Cannot read property '0' of undefined. I have this function on a button. Any kind of help would be nice! Thank you










share|improve this question

























  • Which is line 59?

    – Thum Choon Tat
    Nov 26 '18 at 3:31











  • line 59: for (var a = 0; a < 5; a++)

    – Edrian Yumang
    Nov 26 '18 at 3:37






  • 1





    Possible for you to create a working demo for myself and others to work with?

    – NewToJS
    Nov 26 '18 at 3:41






  • 1





    Maybe this JsFiddle Demo might be of some help. I don't know what you want to order them by but credit to This Answer for the function source code used in my example.

    – NewToJS
    Nov 26 '18 at 3:59











  • I doubt very much that is line 59. The error messages in the console are typically clickable and will take you directly to the source code.

    – Phil
    Nov 26 '18 at 4:58
















-2















I am trying to do a bubblesort. I am using this algorithm to sort a 2d array and I keep getting an error. Here is the function:



var array = [
[ "Rober Hill" , 123.54 ],
[ "Chrsitopher Reddkin", 54.67 ],
[ "Maggie Woods" , 1000.87 ],
[ "Jennifer Jones" , 3.34 ],
[ "Marcus Parker" , 64.98 ]
];
table = document.getElementById("table");

function bubbleSort(array, length, element)
{
var swapped = false;
do
{
for (var a = 0; a < 5; a++) // Line 59
{
if (array[a][1] > array[a+1][1])
{
var temp = array[a][1];
array[a][1] = array[a+1][1];
array[a+1][1] = temp;
swapped = true;
}
}
} while(swapped);

return array;

}


The error says: Sorting.html:59 Uncaught TypeError: Cannot read property '0' of undefined. I have this function on a button. Any kind of help would be nice! Thank you










share|improve this question

























  • Which is line 59?

    – Thum Choon Tat
    Nov 26 '18 at 3:31











  • line 59: for (var a = 0; a < 5; a++)

    – Edrian Yumang
    Nov 26 '18 at 3:37






  • 1





    Possible for you to create a working demo for myself and others to work with?

    – NewToJS
    Nov 26 '18 at 3:41






  • 1





    Maybe this JsFiddle Demo might be of some help. I don't know what you want to order them by but credit to This Answer for the function source code used in my example.

    – NewToJS
    Nov 26 '18 at 3:59











  • I doubt very much that is line 59. The error messages in the console are typically clickable and will take you directly to the source code.

    – Phil
    Nov 26 '18 at 4:58














-2












-2








-2








I am trying to do a bubblesort. I am using this algorithm to sort a 2d array and I keep getting an error. Here is the function:



var array = [
[ "Rober Hill" , 123.54 ],
[ "Chrsitopher Reddkin", 54.67 ],
[ "Maggie Woods" , 1000.87 ],
[ "Jennifer Jones" , 3.34 ],
[ "Marcus Parker" , 64.98 ]
];
table = document.getElementById("table");

function bubbleSort(array, length, element)
{
var swapped = false;
do
{
for (var a = 0; a < 5; a++) // Line 59
{
if (array[a][1] > array[a+1][1])
{
var temp = array[a][1];
array[a][1] = array[a+1][1];
array[a+1][1] = temp;
swapped = true;
}
}
} while(swapped);

return array;

}


The error says: Sorting.html:59 Uncaught TypeError: Cannot read property '0' of undefined. I have this function on a button. Any kind of help would be nice! Thank you










share|improve this question
















I am trying to do a bubblesort. I am using this algorithm to sort a 2d array and I keep getting an error. Here is the function:



var array = [
[ "Rober Hill" , 123.54 ],
[ "Chrsitopher Reddkin", 54.67 ],
[ "Maggie Woods" , 1000.87 ],
[ "Jennifer Jones" , 3.34 ],
[ "Marcus Parker" , 64.98 ]
];
table = document.getElementById("table");

function bubbleSort(array, length, element)
{
var swapped = false;
do
{
for (var a = 0; a < 5; a++) // Line 59
{
if (array[a][1] > array[a+1][1])
{
var temp = array[a][1];
array[a][1] = array[a+1][1];
array[a+1][1] = temp;
swapped = true;
}
}
} while(swapped);

return array;

}


The error says: Sorting.html:59 Uncaught TypeError: Cannot read property '0' of undefined. I have this function on a button. Any kind of help would be nice! Thank you







javascript






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 26 '18 at 4:28









Thum Choon Tat

2,02811216




2,02811216










asked Nov 26 '18 at 3:11









Edrian YumangEdrian Yumang

12




12













  • Which is line 59?

    – Thum Choon Tat
    Nov 26 '18 at 3:31











  • line 59: for (var a = 0; a < 5; a++)

    – Edrian Yumang
    Nov 26 '18 at 3:37






  • 1





    Possible for you to create a working demo for myself and others to work with?

    – NewToJS
    Nov 26 '18 at 3:41






  • 1





    Maybe this JsFiddle Demo might be of some help. I don't know what you want to order them by but credit to This Answer for the function source code used in my example.

    – NewToJS
    Nov 26 '18 at 3:59











  • I doubt very much that is line 59. The error messages in the console are typically clickable and will take you directly to the source code.

    – Phil
    Nov 26 '18 at 4:58



















  • Which is line 59?

    – Thum Choon Tat
    Nov 26 '18 at 3:31











  • line 59: for (var a = 0; a < 5; a++)

    – Edrian Yumang
    Nov 26 '18 at 3:37






  • 1





    Possible for you to create a working demo for myself and others to work with?

    – NewToJS
    Nov 26 '18 at 3:41






  • 1





    Maybe this JsFiddle Demo might be of some help. I don't know what you want to order them by but credit to This Answer for the function source code used in my example.

    – NewToJS
    Nov 26 '18 at 3:59











  • I doubt very much that is line 59. The error messages in the console are typically clickable and will take you directly to the source code.

    – Phil
    Nov 26 '18 at 4:58

















Which is line 59?

– Thum Choon Tat
Nov 26 '18 at 3:31





Which is line 59?

– Thum Choon Tat
Nov 26 '18 at 3:31













line 59: for (var a = 0; a < 5; a++)

– Edrian Yumang
Nov 26 '18 at 3:37





line 59: for (var a = 0; a < 5; a++)

– Edrian Yumang
Nov 26 '18 at 3:37




1




1





Possible for you to create a working demo for myself and others to work with?

– NewToJS
Nov 26 '18 at 3:41





Possible for you to create a working demo for myself and others to work with?

– NewToJS
Nov 26 '18 at 3:41




1




1





Maybe this JsFiddle Demo might be of some help. I don't know what you want to order them by but credit to This Answer for the function source code used in my example.

– NewToJS
Nov 26 '18 at 3:59





Maybe this JsFiddle Demo might be of some help. I don't know what you want to order them by but credit to This Answer for the function source code used in my example.

– NewToJS
Nov 26 '18 at 3:59













I doubt very much that is line 59. The error messages in the console are typically clickable and will take you directly to the source code.

– Phil
Nov 26 '18 at 4:58





I doubt very much that is line 59. The error messages in the console are typically clickable and will take you directly to the source code.

– Phil
Nov 26 '18 at 4:58












2 Answers
2






active

oldest

votes


















1














Running your code exactly as it is, I get:



Cannot read property '1' of undefined



This is because in your comparison, you're attempting to compare array[a][1] > array[a+1][1], and this works except for the last loop, where array[a+1] doesn't exist, and because it doesn't exist, 1 is undefined.



Here's a working solution, with a few notable differences.




  1. I don't know why you had length, and element as parameters for your bubbleSort, but they're gone now

  2. You can just use the array length in your for loop, that way if you add more items to your array, you don't have to update the 5 you had hardcoded.

  3. In the for loop, I minus 1 from the array length so we're never trying to compare the last item against an item after it that doesn't exist.

  4. Also, I used i instead of a, since that's a common variable name for an incrementer.

  5. I defined swapped inside the do...while, otherwise you'll have created an infinite loop because swapped will get set to true on the first pass and stay true forever.

  6. You don't have to return the array, as it is modifying the original in place when you call bubbleSort





var array = [
["Rober Hill", 123.54],
["Chrsitopher Reddkin", 54.67],
["Maggie Woods", 1000.87],
["Jennifer Jones", 3.34],
["Marcus Parker", 64.98]
];

function bubbleSort(array) {
do {
var swapped = false;

for (var i = 0; i < array.length - 1; i++) {
if (array[i][1] > array[i + 1][1]) {
var temp = array[i];

array[i] = array[i + 1];
array[i + 1] = temp;

swapped = true;
}
}
} while (swapped);
}

bubbleSort(array)
console.log(array);








share|improve this answer

































    0














    Move var swapped = false; inside do {....



    Also update condition in for it should be like a < 4; or it's better if you use generalized condition as a < array.length - 1;






    var array = [
    ["Rober Hill", 123.54],
    ["Chrsitopher Reddkin", 54.67],
    ["Maggie Woods", 1000.87],
    ["Jennifer Jones", 3.34],
    ["Marcus Parker", 64.98]
    ];

    function bubbleSort(array, length, element) {
    do {
    var swapped = false;
    for (var a = 0; a < array.length - 1; a++) // Line 59
    {
    if (array[a][1] > array[a + 1][1]) {
    var temp = array[a][1];
    array[a][1] = array[a + 1][1];
    array[a + 1][1] = temp;
    swapped = true;
    }
    }
    } while (swapped);

    return array;

    }

    console.log(bubbleSort(array));








    share|improve this answer























      Your Answer






      StackExchange.ifUsing("editor", function () {
      StackExchange.using("externalEditor", function () {
      StackExchange.using("snippets", function () {
      StackExchange.snippets.init();
      });
      });
      }, "code-snippets");

      StackExchange.ready(function() {
      var channelOptions = {
      tags: "".split(" "),
      id: "1"
      };
      initTagRenderer("".split(" "), "".split(" "), channelOptions);

      StackExchange.using("externalEditor", function() {
      // Have to fire editor after snippets, if snippets enabled
      if (StackExchange.settings.snippets.snippetsEnabled) {
      StackExchange.using("snippets", function() {
      createEditor();
      });
      }
      else {
      createEditor();
      }
      });

      function createEditor() {
      StackExchange.prepareEditor({
      heartbeatType: 'answer',
      autoActivateHeartbeat: false,
      convertImagesToLinks: true,
      noModals: true,
      showLowRepImageUploadWarning: true,
      reputationToPostImages: 10,
      bindNavPrevention: true,
      postfix: "",
      imageUploader: {
      brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
      contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
      allowUrls: true
      },
      onDemand: true,
      discardSelector: ".discard-answer"
      ,immediatelyShowMarkdownHelp:true
      });


      }
      });














      draft saved

      draft discarded


















      StackExchange.ready(
      function () {
      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53474321%2fi-keep-getting-cannot-read-property-error%23new-answer', 'question_page');
      }
      );

      Post as a guest















      Required, but never shown

























      2 Answers
      2






      active

      oldest

      votes








      2 Answers
      2






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes









      1














      Running your code exactly as it is, I get:



      Cannot read property '1' of undefined



      This is because in your comparison, you're attempting to compare array[a][1] > array[a+1][1], and this works except for the last loop, where array[a+1] doesn't exist, and because it doesn't exist, 1 is undefined.



      Here's a working solution, with a few notable differences.




      1. I don't know why you had length, and element as parameters for your bubbleSort, but they're gone now

      2. You can just use the array length in your for loop, that way if you add more items to your array, you don't have to update the 5 you had hardcoded.

      3. In the for loop, I minus 1 from the array length so we're never trying to compare the last item against an item after it that doesn't exist.

      4. Also, I used i instead of a, since that's a common variable name for an incrementer.

      5. I defined swapped inside the do...while, otherwise you'll have created an infinite loop because swapped will get set to true on the first pass and stay true forever.

      6. You don't have to return the array, as it is modifying the original in place when you call bubbleSort





      var array = [
      ["Rober Hill", 123.54],
      ["Chrsitopher Reddkin", 54.67],
      ["Maggie Woods", 1000.87],
      ["Jennifer Jones", 3.34],
      ["Marcus Parker", 64.98]
      ];

      function bubbleSort(array) {
      do {
      var swapped = false;

      for (var i = 0; i < array.length - 1; i++) {
      if (array[i][1] > array[i + 1][1]) {
      var temp = array[i];

      array[i] = array[i + 1];
      array[i + 1] = temp;

      swapped = true;
      }
      }
      } while (swapped);
      }

      bubbleSort(array)
      console.log(array);








      share|improve this answer






























        1














        Running your code exactly as it is, I get:



        Cannot read property '1' of undefined



        This is because in your comparison, you're attempting to compare array[a][1] > array[a+1][1], and this works except for the last loop, where array[a+1] doesn't exist, and because it doesn't exist, 1 is undefined.



        Here's a working solution, with a few notable differences.




        1. I don't know why you had length, and element as parameters for your bubbleSort, but they're gone now

        2. You can just use the array length in your for loop, that way if you add more items to your array, you don't have to update the 5 you had hardcoded.

        3. In the for loop, I minus 1 from the array length so we're never trying to compare the last item against an item after it that doesn't exist.

        4. Also, I used i instead of a, since that's a common variable name for an incrementer.

        5. I defined swapped inside the do...while, otherwise you'll have created an infinite loop because swapped will get set to true on the first pass and stay true forever.

        6. You don't have to return the array, as it is modifying the original in place when you call bubbleSort





        var array = [
        ["Rober Hill", 123.54],
        ["Chrsitopher Reddkin", 54.67],
        ["Maggie Woods", 1000.87],
        ["Jennifer Jones", 3.34],
        ["Marcus Parker", 64.98]
        ];

        function bubbleSort(array) {
        do {
        var swapped = false;

        for (var i = 0; i < array.length - 1; i++) {
        if (array[i][1] > array[i + 1][1]) {
        var temp = array[i];

        array[i] = array[i + 1];
        array[i + 1] = temp;

        swapped = true;
        }
        }
        } while (swapped);
        }

        bubbleSort(array)
        console.log(array);








        share|improve this answer




























          1












          1








          1







          Running your code exactly as it is, I get:



          Cannot read property '1' of undefined



          This is because in your comparison, you're attempting to compare array[a][1] > array[a+1][1], and this works except for the last loop, where array[a+1] doesn't exist, and because it doesn't exist, 1 is undefined.



          Here's a working solution, with a few notable differences.




          1. I don't know why you had length, and element as parameters for your bubbleSort, but they're gone now

          2. You can just use the array length in your for loop, that way if you add more items to your array, you don't have to update the 5 you had hardcoded.

          3. In the for loop, I minus 1 from the array length so we're never trying to compare the last item against an item after it that doesn't exist.

          4. Also, I used i instead of a, since that's a common variable name for an incrementer.

          5. I defined swapped inside the do...while, otherwise you'll have created an infinite loop because swapped will get set to true on the first pass and stay true forever.

          6. You don't have to return the array, as it is modifying the original in place when you call bubbleSort





          var array = [
          ["Rober Hill", 123.54],
          ["Chrsitopher Reddkin", 54.67],
          ["Maggie Woods", 1000.87],
          ["Jennifer Jones", 3.34],
          ["Marcus Parker", 64.98]
          ];

          function bubbleSort(array) {
          do {
          var swapped = false;

          for (var i = 0; i < array.length - 1; i++) {
          if (array[i][1] > array[i + 1][1]) {
          var temp = array[i];

          array[i] = array[i + 1];
          array[i + 1] = temp;

          swapped = true;
          }
          }
          } while (swapped);
          }

          bubbleSort(array)
          console.log(array);








          share|improve this answer















          Running your code exactly as it is, I get:



          Cannot read property '1' of undefined



          This is because in your comparison, you're attempting to compare array[a][1] > array[a+1][1], and this works except for the last loop, where array[a+1] doesn't exist, and because it doesn't exist, 1 is undefined.



          Here's a working solution, with a few notable differences.




          1. I don't know why you had length, and element as parameters for your bubbleSort, but they're gone now

          2. You can just use the array length in your for loop, that way if you add more items to your array, you don't have to update the 5 you had hardcoded.

          3. In the for loop, I minus 1 from the array length so we're never trying to compare the last item against an item after it that doesn't exist.

          4. Also, I used i instead of a, since that's a common variable name for an incrementer.

          5. I defined swapped inside the do...while, otherwise you'll have created an infinite loop because swapped will get set to true on the first pass and stay true forever.

          6. You don't have to return the array, as it is modifying the original in place when you call bubbleSort





          var array = [
          ["Rober Hill", 123.54],
          ["Chrsitopher Reddkin", 54.67],
          ["Maggie Woods", 1000.87],
          ["Jennifer Jones", 3.34],
          ["Marcus Parker", 64.98]
          ];

          function bubbleSort(array) {
          do {
          var swapped = false;

          for (var i = 0; i < array.length - 1; i++) {
          if (array[i][1] > array[i + 1][1]) {
          var temp = array[i];

          array[i] = array[i + 1];
          array[i + 1] = temp;

          swapped = true;
          }
          }
          } while (swapped);
          }

          bubbleSort(array)
          console.log(array);








          var array = [
          ["Rober Hill", 123.54],
          ["Chrsitopher Reddkin", 54.67],
          ["Maggie Woods", 1000.87],
          ["Jennifer Jones", 3.34],
          ["Marcus Parker", 64.98]
          ];

          function bubbleSort(array) {
          do {
          var swapped = false;

          for (var i = 0; i < array.length - 1; i++) {
          if (array[i][1] > array[i + 1][1]) {
          var temp = array[i];

          array[i] = array[i + 1];
          array[i + 1] = temp;

          swapped = true;
          }
          }
          } while (swapped);
          }

          bubbleSort(array)
          console.log(array);





          var array = [
          ["Rober Hill", 123.54],
          ["Chrsitopher Reddkin", 54.67],
          ["Maggie Woods", 1000.87],
          ["Jennifer Jones", 3.34],
          ["Marcus Parker", 64.98]
          ];

          function bubbleSort(array) {
          do {
          var swapped = false;

          for (var i = 0; i < array.length - 1; i++) {
          if (array[i][1] > array[i + 1][1]) {
          var temp = array[i];

          array[i] = array[i + 1];
          array[i + 1] = temp;

          swapped = true;
          }
          }
          } while (swapped);
          }

          bubbleSort(array)
          console.log(array);






          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Nov 26 '18 at 5:15

























          answered Nov 26 '18 at 5:03









          AnonymousSBAnonymousSB

          2,194221




          2,194221

























              0














              Move var swapped = false; inside do {....



              Also update condition in for it should be like a < 4; or it's better if you use generalized condition as a < array.length - 1;






              var array = [
              ["Rober Hill", 123.54],
              ["Chrsitopher Reddkin", 54.67],
              ["Maggie Woods", 1000.87],
              ["Jennifer Jones", 3.34],
              ["Marcus Parker", 64.98]
              ];

              function bubbleSort(array, length, element) {
              do {
              var swapped = false;
              for (var a = 0; a < array.length - 1; a++) // Line 59
              {
              if (array[a][1] > array[a + 1][1]) {
              var temp = array[a][1];
              array[a][1] = array[a + 1][1];
              array[a + 1][1] = temp;
              swapped = true;
              }
              }
              } while (swapped);

              return array;

              }

              console.log(bubbleSort(array));








              share|improve this answer




























                0














                Move var swapped = false; inside do {....



                Also update condition in for it should be like a < 4; or it's better if you use generalized condition as a < array.length - 1;






                var array = [
                ["Rober Hill", 123.54],
                ["Chrsitopher Reddkin", 54.67],
                ["Maggie Woods", 1000.87],
                ["Jennifer Jones", 3.34],
                ["Marcus Parker", 64.98]
                ];

                function bubbleSort(array, length, element) {
                do {
                var swapped = false;
                for (var a = 0; a < array.length - 1; a++) // Line 59
                {
                if (array[a][1] > array[a + 1][1]) {
                var temp = array[a][1];
                array[a][1] = array[a + 1][1];
                array[a + 1][1] = temp;
                swapped = true;
                }
                }
                } while (swapped);

                return array;

                }

                console.log(bubbleSort(array));








                share|improve this answer


























                  0












                  0








                  0







                  Move var swapped = false; inside do {....



                  Also update condition in for it should be like a < 4; or it's better if you use generalized condition as a < array.length - 1;






                  var array = [
                  ["Rober Hill", 123.54],
                  ["Chrsitopher Reddkin", 54.67],
                  ["Maggie Woods", 1000.87],
                  ["Jennifer Jones", 3.34],
                  ["Marcus Parker", 64.98]
                  ];

                  function bubbleSort(array, length, element) {
                  do {
                  var swapped = false;
                  for (var a = 0; a < array.length - 1; a++) // Line 59
                  {
                  if (array[a][1] > array[a + 1][1]) {
                  var temp = array[a][1];
                  array[a][1] = array[a + 1][1];
                  array[a + 1][1] = temp;
                  swapped = true;
                  }
                  }
                  } while (swapped);

                  return array;

                  }

                  console.log(bubbleSort(array));








                  share|improve this answer













                  Move var swapped = false; inside do {....



                  Also update condition in for it should be like a < 4; or it's better if you use generalized condition as a < array.length - 1;






                  var array = [
                  ["Rober Hill", 123.54],
                  ["Chrsitopher Reddkin", 54.67],
                  ["Maggie Woods", 1000.87],
                  ["Jennifer Jones", 3.34],
                  ["Marcus Parker", 64.98]
                  ];

                  function bubbleSort(array, length, element) {
                  do {
                  var swapped = false;
                  for (var a = 0; a < array.length - 1; a++) // Line 59
                  {
                  if (array[a][1] > array[a + 1][1]) {
                  var temp = array[a][1];
                  array[a][1] = array[a + 1][1];
                  array[a + 1][1] = temp;
                  swapped = true;
                  }
                  }
                  } while (swapped);

                  return array;

                  }

                  console.log(bubbleSort(array));








                  var array = [
                  ["Rober Hill", 123.54],
                  ["Chrsitopher Reddkin", 54.67],
                  ["Maggie Woods", 1000.87],
                  ["Jennifer Jones", 3.34],
                  ["Marcus Parker", 64.98]
                  ];

                  function bubbleSort(array, length, element) {
                  do {
                  var swapped = false;
                  for (var a = 0; a < array.length - 1; a++) // Line 59
                  {
                  if (array[a][1] > array[a + 1][1]) {
                  var temp = array[a][1];
                  array[a][1] = array[a + 1][1];
                  array[a + 1][1] = temp;
                  swapped = true;
                  }
                  }
                  } while (swapped);

                  return array;

                  }

                  console.log(bubbleSort(array));





                  var array = [
                  ["Rober Hill", 123.54],
                  ["Chrsitopher Reddkin", 54.67],
                  ["Maggie Woods", 1000.87],
                  ["Jennifer Jones", 3.34],
                  ["Marcus Parker", 64.98]
                  ];

                  function bubbleSort(array, length, element) {
                  do {
                  var swapped = false;
                  for (var a = 0; a < array.length - 1; a++) // Line 59
                  {
                  if (array[a][1] > array[a + 1][1]) {
                  var temp = array[a][1];
                  array[a][1] = array[a + 1][1];
                  array[a + 1][1] = temp;
                  swapped = true;
                  }
                  }
                  } while (swapped);

                  return array;

                  }

                  console.log(bubbleSort(array));






                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Nov 26 '18 at 4:58









                  KaranKaran

                  3,2082424




                  3,2082424






























                      draft saved

                      draft discarded




















































                      Thanks for contributing an answer to Stack Overflow!


                      • Please be sure to answer the question. Provide details and share your research!

                      But avoid



                      • Asking for help, clarification, or responding to other answers.

                      • Making statements based on opinion; back them up with references or personal experience.


                      To learn more, see our tips on writing great answers.




                      draft saved


                      draft discarded














                      StackExchange.ready(
                      function () {
                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53474321%2fi-keep-getting-cannot-read-property-error%23new-answer', 'question_page');
                      }
                      );

                      Post as a guest















                      Required, but never shown





















































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown

































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown







                      Popular posts from this blog

                      Lallio

                      Futebolista

                      Jornalista