From aa40504dd56634df99ddf2f95d43a288f5632bac Mon Sep 17 00:00:00 2001 From: Frederic Junod Date: Thu, 28 Aug 2014 17:33:14 +0200 Subject: [PATCH] Improve ol.Collection documentation --- src/ol/collection.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/ol/collection.js b/src/ol/collection.js index 00ea229535..77acfc6c9e 100644 --- a/src/ol/collection.js +++ b/src/ol/collection.js @@ -192,8 +192,9 @@ ol.Collection.prototype.insertAt = function(index, elem) { /** - * Remove the last element of the collection. - * @return {T} Element. + * Remove the last element of the collection and return it. + * Return `undefined` if the collection is empty. + * @return {T|undefined} Element. * @api stable */ ol.Collection.prototype.pop = function() { @@ -233,9 +234,10 @@ ol.Collection.prototype.remove = function(elem) { /** - * Remove the element at the provided index. + * Remove the element at the provided index and return it. + * Return `undefined` if the collection does not contain this index. * @param {number} index Index. - * @return {T} Value. + * @return {T|undefined} Value. * @api stable */ ol.Collection.prototype.removeAt = function(index) {