title: Why won't .split() function work with vue.js 2?
body: <p>I'm building my first app with vue.js, but am at a loss for why my go-to JavaScript functions aren't working. </p>
  
  <p>I'm importing a JSON file and trying to build a <code>geojson</code> object from it. To do so, I need to split its <code>latlong</code> string (e.g. <code>latlon:"52.3723138,0.4903593"</code>) into an array of numbers like <code>[52.3, 0.49]</code>. <code>String.split()</code> seems like the obvious function to use, but it's not working in this environment.</p>
  
  <p>The json file is of this structure:</p>
  
  <pre><code>{ affiliates: [  ] }
  </code></pre>
  
  <p>I'm passing the JSON affiliates array to the <code>makeGeoJson</code> function as the data argument.</p>
  
  <p>Here's the code I'm trying: </p>
  
  <pre><code>makeGeoJson(data) {
    var geoJsonFeatures = [];
    data.forEach(function(gym) {
      var feature = {
        "type": "Feature",
        "properties": gym,
        "geometry": {
          "type": "Point",
          "coordinates": [parseFloat(gym.latlon.split(",")[0]), parseFloat(gym.latlon.split(",")[1])]
        }
      };
      geoJsonFeatures.push(feature);
    });
  },
  </code></pre>
  
  <p>The error I get says</p>
  
  <pre class="lang-none prettyprint-override"><code>TypeError: Cannot read property 'split' of undefined
      at eval (eval at 50 (http://localhost:8080/0.9506ad4988fb1af5b77e.hot-update.js:7:1), &lt;anonymous&gt;:47:37)
  </code></pre>
  
  <p>I'm using Vue.js 2.2 and used the vue-cli to set it up.</p>
  
  <p>Is this related to why I am also not able to push data to arrays in this same function? </p>