Leaflet: make an array of array to feed in L.polyLine() method of leaflet javscript library

I am working on javascript leaflet library to draw dynamically generated coordinates and line between two such recent pairs. I have found that I can achieve that task using this code:
L.polyline(coordinatesArray, {color: 'red'}).addTo(map);

Here's definition of coordinates array:var coordinatesArray=[];

And whenver I get a new data,I push that in the array like this:

        coordinatesArray.push([coordinate[0],coordinate[1]]);
        L.polyline(coordinatesArray, {color: 'red'}).addTo(map); // line #107 as described in the error
        map.fitBounds(polyline.getBounds());

I have run a raw code about how to feed and array in an array in javascript, for example:

var c=[];
 c.push([0,0]);
 c.push([1,1]);
 for(var i=0; i<c.length;i++){
   console.log(c);
 }

So, I think, I have implemented the L.polyline(...,..) method pretty well. But still getting the following error:

Uncaught TypeError: Cannot read property 'length' of undefined
    at e.projectLatlngs (leaflet.js:8)
    at e.onAdd (leaflet.js:7)
    at e._layerAdd (leaflet.js:6)
    at e.addLayer (leaflet.js:6)
    at e.addTo (leaflet.js:7)
    at (index):107
    at r.onmessage (stomp.min.js:8)
    at r.n.dispatchEvent (sockjs.min.js:2)
    at sockjs.min.js:2
    at Array.forEach (<anonymous>)