00 Votes
JavaScript: How to reset array's protoype in JavaScript ?
Question by Wordpress-developer | 2021-08-13 at 14:59
Array.prototype.min = function() { return Math.min.apply(Math,this); };
How to reset Array.prototype ?
ReplyPositiveNegative
Reply
Related Topics
JavaScript: Create and Use Arrays
Info | 0 Comments
PHP: Remove all empty elements from string array
Tip | 0 Comments
Lazarus: Load File as Byte Array and save Byte Array as File
Tutorial | 0 Comments
Send Form Input as an Array to PHP Script
Tip | 0 Comments
PHP: Write array to individual Variables
Tutorial | 0 Comments
Create URL for Website from Title of Page
Tutorial | 0 Comments
JavaScript: Sort Array of Numbers
Tutorial | 0 Comments
Important Note
Please note: The contributions published on askingbox.com are contributions of users and should not substitute professional advice. They are not verified by independents and do not necessarily reflect the opinion of askingbox.com. Learn more.
Participate
Ask your own question or write your own article on askingbox.com. That’s how it’s done.
First of all, I would never override any of the default function.
If you cannot prevent this, for example because of an external script does the override, you can do the following:
Use a variable to store the old function in it before the script changes it. Then you can restore the function with setting Array.prototype.min back to the variable afterwards.
2021-08-13 at 16:16