source: imaps-frontend/node_modules/core-js/modules/esnext.array.last-index.js

main
Last change on this file was 79a0317, checked in by stefan toskovski <stefantoska84@…>, 4 days ago

F4 Finalna Verzija

  • Property mode set to 100644
File size: 743 bytes
RevLine 
[79a0317]1'use strict';
2// TODO: Remove from `core-js@4`
3var DESCRIPTORS = require('../internals/descriptors');
4var addToUnscopables = require('../internals/add-to-unscopables');
5var toObject = require('../internals/to-object');
6var lengthOfArrayLike = require('../internals/length-of-array-like');
7var defineBuiltInAccessor = require('../internals/define-built-in-accessor');
8
9// `Array.prototype.lastIndex` getter
10// https://github.com/keithamus/proposal-array-last
11if (DESCRIPTORS) {
12 defineBuiltInAccessor(Array.prototype, 'lastIndex', {
13 configurable: true,
14 get: function lastIndex() {
15 var O = toObject(this);
16 var len = lengthOfArrayLike(O);
17 return len === 0 ? 0 : len - 1;
18 }
19 });
20
21 addToUnscopables('lastIndex');
22}
Note: See TracBrowser for help on using the repository browser.