/**
 * Generates a new GeoJSON Polygon feature, given an array of coordinates
 * and list of properties.
 *
 * @module turf/polygon
 * @param {number[][]} rings - an array of LinearRings
 * @param {Object} properties - an optional properties object
 * @return {GeoJSONPolygon} output
 * @example
 * var poly1 = turf.polygon([[[20.0,0.0],[101.0,0.0],[101.0,1.0],[100.0,1.0],[100.0,0.0]]])
 * var poly2 = turf.polygon([[[20.0,0.0],[101.0,0.0],[101.0,1.0],[100.0,1.0],[100.0,0.0]]],
 *   {name: 'line 1', distance: 145})
 * console.log(poly1)
 * console.log(poly2)
 */
module.exports = function(coordinates, properties){
  if(coordinates === null) return new Error('No coordinates passed');
  if((coordinates[0][0] !== coordinates[coordinates.length - 1][0]) || (coordinates[0][1] !== coordinates[coordinates.length - 1][1])) return new Error('First and last coordinate pair are not equivalent');
  var polygon = { 
    "type": "Feature",
    "geometry": {
      "type": "Polygon",
      "coordinates": coordinates
    },
    "properties": properties
  };

  if(!polygon.properties){
    polygon.properties = {};
  }
  
  return polygon;
}

@@ -689,32 +689,11 @@
   if
+ 
 ((
-coordinates%5B0%5D%5B0%5D !== 
 coor
@@ -727,17 +727,20 @@
 - 1%5D
-%5B0%5D) %7C%7C (
+.length !== 
 coor
@@ -753,16 +753,20 @@
 s%5B0%5D
-%5B1%5D !== 
+.length %7C%7C !
 coor
@@ -800,13 +800,108 @@
 - 1%5D
-%5B1%5D))
+.every(function(position, index) %7B%0A      return coordinates%5B0%5D%5Bindex%5D === position;%0A    %7D))) %7B%0A     
  ret
@@ -968,16 +968,21 @@
 lent');%0A
+  %7D;%0A
   var po

Include conditions for multi-dimensional coordinates