Download pool/shard002/JavaScript/0012807_es6.string.ends-with.js from Variable-role/sajaniemi_variable_dataset_large: direct link, hf CLI and curl.
- Browser
- Download file 597 Bytes
-
https://huggingface.co/datasets/Variable-role/sajaniemi_variable_dataset_large/resolve/main/pool/shard002/JavaScript/0012807_es6.string.ends-with.js
- Command line
-
hf download hf://datasets/Variable-role/sajaniemi_variable_dataset_large/pool/shard002/JavaScript/0012807_es6.string.ends-with.js
-
curl -L -o 0012807_es6.string.ends-with.js https://huggingface.co/datasets/Variable-role/sajaniemi_variable_dataset_large/resolve/main/pool/shard002/JavaScript/0012807_es6.string.ends-with.js
597 Bytes
| /* */ | |
| ; | |
| var $def = require('./$.def'), | |
| toLength = require('./$.to-length'), | |
| context = require('./$.string-context'); | |
| $def($def.P + $def.F * !require('./$.fails')(function() { | |
| 'q'.endsWith(/./); | |
| }), 'String', {endsWith: function endsWith(searchString) { | |
| var that = context(this, searchString, 'endsWith'), | |
| endPosition = arguments[1], | |
| len = toLength(that.length), | |
| end = endPosition === undefined ? len : Math.min(toLength(endPosition), len), | |
| search = String(searchString); | |
| return that.slice(end - search.length, end) === search; | |
| }}); | |