MCPcopy Create free account
hub / github.com/ampproject/amphtml / sort

Function sort

extensions/amp-bind/0.1/bind-expression.js:78–85  ·  view source on GitHub ↗

* Deprecated. Static, not-in-place variant of Array#sort. * @param {!Array} array * @return {!Array}

(array)

Source from the content-addressed store, hash-verified

76 * @return {!Array}
77 */
78 function sort(array) {
79 if (!isArray(array)) {
80 throw new Error(`sort: ${array} is not an array.`);
81 }
82 const copy = Array.prototype.slice.call(array);
83 Array.prototype.sort.call(copy);
84 return copy;
85 }
86
87 /**
88 * Needs to be wrapped to avoid a duplicate name conflict with the deprecated

Callers

nothing calls this directly

Calls 1

isArrayFunction · 0.85

Tested by

no test coverage detected