mirror of
https://github.com/Ylianst/MeshCentral.git
synced 2024-12-26 23:25:53 -05:00
Added polyfill for Array.findIndex() if missing
This commit is contained in:
parent
bf1e30237c
commit
b58d7837a3
@ -26,6 +26,27 @@ try
|
||||
catch(x)
|
||||
{
|
||||
|
||||
}
|
||||
try
|
||||
{
|
||||
Object.defineProperty(Array.prototype, 'findIndex', {
|
||||
value: function (func)
|
||||
{
|
||||
var i = 0;
|
||||
for (i = 0; i < this.length; ++i)
|
||||
{
|
||||
if (func(this[i], i, this))
|
||||
{
|
||||
return (i);
|
||||
}
|
||||
}
|
||||
return (-1);
|
||||
}
|
||||
});
|
||||
}
|
||||
catch (x)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
if (process.platform != 'win32')
|
||||
|
Loading…
Reference in New Issue
Block a user