Skip to content

Commit 809e3f4

Browse files
committed
Added jsdocs
1 parent 9e6298b commit 809e3f4

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

src/utils/array/FindClosestInSorted.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,10 @@
55
*/
66

77
/**
8-
* [description]
8+
* Searches a pre-sorted array for the closet value to the given number.
9+
*
10+
* If the `key` argument is given it will assume the array contains objects that all have the required `key` property name,
11+
* and will check for the closest value of those to the given number.
912
*
1013
* @function Phaser.Utils.Array.FindClosestInSorted
1114
* @since 3.0.0
@@ -14,7 +17,7 @@
1417
* @param {array} array - The array to search, which must be sorted.
1518
* @param {string} [key] - An optional property key. If specified the array elements property will be checked against value.
1619
*
17-
* @return {number|object} The nearest value found in the array, or if a `key` was given, the nearest object with the matching property value.
20+
* @return {(number|any)} The nearest value found in the array, or if a `key` was given, the nearest object with the matching property value.
1821
*/
1922
var FindClosestInSorted = function (value, array, key)
2023
{

0 commit comments

Comments
 (0)