Merge pull request #2652 from fredj/collection-doc

Improve ol.Collection documentation
This commit is contained in:
Éric Lemoine
2014-08-29 11:49:28 +02:00
+6 -4
View File
@@ -192,8 +192,9 @@ ol.Collection.prototype.insertAt = function(index, elem) {
/** /**
* Remove the last element of the collection. * Remove the last element of the collection and return it.
* @return {T} Element. * Return `undefined` if the collection is empty.
* @return {T|undefined} Element.
* @api stable * @api stable
*/ */
ol.Collection.prototype.pop = function() { 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. * @param {number} index Index.
* @return {T} Value. * @return {T|undefined} Value.
* @api stable * @api stable
*/ */
ol.Collection.prototype.removeAt = function(index) { ol.Collection.prototype.removeAt = function(index) {