MCPcopy Index your code
hub / github.com/SeleniumHQ/selenium / toArray

Function toArray

third_party/closure/goog/array/array.js:836–850  ·  view source on GitHub ↗

* Converts an object to an array. * @param {IArrayLike |string} object The object to convert to an * array. * @return {!Array } The object converted into an array. If object has a * length property, every property indexed with a non-negative number * less than length will be in

(object)

Source from the content-addressed store, hash-verified

834 * @template T
835 */
836function toArray(object) {
837 const length = object.length;
838
839 // If length is not a number the following is false. This case is kept for
840 // backwards compatibility since there are callers that pass objects that are
841 // not array like.
842 if (length > 0) {
843 const rv = new Array(length);
844 for (let i = 0; i < length; i++) {
845 rv[i] = object[i];
846 }
847 return rv;
848 }
849 return [];
850}
851exports.toArray = toArray;
852
853

Callers 1

subscribeMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected