9 lines
258 B
TypeScript
9 lines
258 B
TypeScript
![]() |
export const NumberExtensions = () => {
|
||
|
if (Number().fromArray === undefined) {
|
||
|
// eslint-disable-next-line no-extend-native
|
||
|
Number.prototype.fromArray = function () {
|
||
|
return Array.from(this.toString()).map((el) => Number(el));
|
||
|
};
|
||
|
}
|
||
|
};
|