module.exports = function( collection, count, options ){
	options = options || count;
	count = ( typeof count === 'number' ) ? count : 1;
	var result = '';
	for( var i = 0; i < collection.length; i++ ){
		result += options.fn( collection[collection.length-count+i] );
		if( i + 1 == count ) return result;
	}
};
@@ -136,25 +136,174 @@
 1;%0A%09
-var result = ''
+// if collection is an object, make it an array%0A%09// otherwise we have no way to clip off the %22end%22%0A%09if( !Array.isArray( collection ) )%7B%0A%09%09var collection_array = %5B%5D
 ;%0A
+%09
 %09for
@@ -312,68 +312,167 @@
 var 
-i = 0; i %3C collection.length; i++ )%7B%0A%09%09result += options.fn(
+key in collection )%7B%0A%09%09%09if( collection.hasOwnProperty( key ) )%7B%0A%09%09%09%09collection_array.push( collection%5Bkey%5D );%0A%09%09%09%7D%0A%09%09%7D%0A%09%09collection = collection_array;%0A%09%7D%0A%09var
  col
@@ -478,17 +478,24 @@
 llection
-%5B
+_last = 
 collecti
@@ -501,50 +501,152 @@
 ion.
-length-
+slice( -1 * 
 count
-+i%5D
  );%0A%09
-%09if( i + 1 == count ) 
+var result = collection_last.reduce( function( previous, current )%7B%0A%09%09return previous + options.fn( current );%0A%09%7D, '' );%0A%09
 retu
@@ -656,13 +656,10 @@
 result;%0A
-%09%7D%0A
 %7D;

convert object passed to last into array