title: How to remove square brackets in a Javascript array?
body: <p>I have an array called <code>value</code> and when I <code>console.log(value)</code> I get about 30 lines of code with the following <code>[6.443663, 3.419248]</code></p>
  
  <p>The numbers change as they are Latitudes and Longitudes. But I need to somehow get rid of the square brackets around each one.</p>
  
  <p>I tried <code>var replaced = value.toString().replace(/\[.*\]/g,'');</code> but this changed the above example to <code>6.443407,3.419035000000008</code> and failed my code.</p>
  
  <p>In other words I need help getting rid of square brackets in an array in order to plot points on my map.</p>
  
  <p>My array is made up from the following code because each latitude and longitude value is held within <code>onClick</code> functions within <code>a</code> links. So a member on here kindly supplied the below code to get my values into an array but now I'm struggling to get the values out without any brackets ruining it.</p>
  
  <pre><code>var obj = {};
  $('.choice-location-inner a').each(function(){
      var $this = $(this);
      var text = $this.attr('onClick').replace('findLocation(\'', '').replace('\');return false;', '');
      var array = text.split(',')
      obj[this.id]= [parseFloat(array[0]), parseFloat(array[1])];
  });
  </code></pre>
  
  <p>The array is trying to plot markers on my Google Map using the following code</p>
  
  <pre><code>$.each(obj , function(index, value){
      geocoder = new google.maps.Geocoder();
  
      geocoder.geocode( { 'address': value}, function(results, status) {
          if (status == google.maps.GeocoderStatus.OK) {
              map.setCenter(results[0].geometry.location);
              marker = new google.maps.Marker({
                  map: map,
                  icon: image,
                  position: results[0].geometry.location
              });
          } else if (status == google.maps.GeocoderStatus.OVER_QUERY_LIMIT) {
              wait = true;
              setTimeout("wait = false", 1000);
          } else {
              alert("Geocode was not successful for the following reason: " + status);
          }
      });
  });
  </code></pre>