title: ArcGIS JS not performing GeometryService cut method
body: <p>I have an app where users can draw a shape on the map to indicate potential land use, and they can also draw a shape to indicate a 'no change' zone, where we want to indicate no development plans.</p>
  
  <p>Basically, they can create a shape to indicate an industrial zone, and then they could draw an overlapping shape to basically cut out that industrial zone, and designate that zone as a no-development zone.</p>
  
  <p>Here's my code:</p>
  
  <pre><code>function cutOutNoChangeZone () {
      var geometries = land_use_planning.graphics,
          geometries_to_be_cut,
          geoService = new esri.tasks.GeometryService("http://gis.website.com/ArcGIS/rest/services/Geometry/GeometryServer");
  
      for (var i = 0, len = geometries.length; i &lt; len; i++) {
          var geometry = geometries[i];
          if (geometry.planning_type === 'no_change') {
              // cut ALL polygons that are under the no change zone
              geometries_to_be_cut = geometries.slice(0, i);
              // NEXT LINE THROWS ERROR
              geoService.cut(geometries_to_be_cut, geometry);
          }
      }
  }
  </code></pre>
  
  <p>It throws an error in the console: </p>
  
  <blockquote>
    <p>TypeError: Cannot read property 'toJson' of undefined</p>
  </blockquote>
  
  <p>It's coming from the minified ArcGIS 3.9 <code>init.js</code> file on the js.arcgis.com server.  I have already debugged the for loop to check that the geometries are valid geometries, with <code>toJson</code> methods.  I was trying to follow the example on this esri forum, which shows a similar function: <a href="https://geonet.esri.com/thread/63777" rel="nofollow">https://geonet.esri.com/thread/63777</a>.</p>
  
  <p>Also note that I am testing this on only two shapes: one industrial and one "no-change" that overlaps.  <code>geometries_to_be_cut</code> is an array of the single geometry, and <code>geometry</code> is the "no-change" geometry.  </p>
  
  <p>It seems like this should be a simple function.  I'm not sure where I'm going wrong, and thought someone might have some insight on this.</p>