Download material-table/src/utils/polyfill/array.find.js from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 559 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/1e92f2d0b9e054abc23a53595fd89ad3e2b4a34e/material-table/src/utils/polyfill/array.find.js
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset@1e92f2d0b9e054abc23a53595fd89ad3e2b4a34e/material-table/src/utils/polyfill/array.find.js
-
curl -L -o array.find.js https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/1e92f2d0b9e054abc23a53595fd89ad3e2b4a34e/material-table/src/utils/polyfill/array.find.js
559 Bytes
| Object.defineProperty(Array.prototype, "find", { | |
| value: function (predicate) { | |
| if (this == null) { | |
| throw new TypeError('"this" is null or not defined'); | |
| } | |
| var o = Object(this); | |
| var len = o.length >>> 0; | |
| if (typeof predicate !== "function") { | |
| throw new TypeError("predicate must be a function"); | |
| } | |
| var thisArg = arguments[1]; | |
| var k = 0; | |
| while (k < len) { | |
| var kValue = o[k]; | |
| if (predicate.call(thisArg, kValue, k, o)) { | |
| return kValue; | |
| } | |
| k++; | |
| } | |
| return undefined; | |
| }, | |
| }); | |