0% found this document useful (0 votes)
27 views2 pages

DFGFH 5

The document defines several enhancements to the Number and Array prototypes in JavaScript. It includes methods for number normalization, bit manipulation, formatting, and array element searching. These enhancements provide additional functionality for numerical operations and array handling.

Uploaded by

vanek198804
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
27 views2 pages

DFGFH 5

The document defines several enhancements to the Number and Array prototypes in JavaScript. It includes methods for number normalization, bit manipulation, formatting, and array element searching. These enhancements provide additional functionality for numerical operations and array handling.

Uploaded by

vanek198804
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

(function() {

var w = H.na;
Number.Ga = 2147483647;
Number.Yb = 4294967295;
Number.G = 1.7976931348623157E308;
var J = [1, 10, 100, 1E3, 1E4, 1E5, 1E6, 1E7, 1E8];
Number.prototype.normalize = function(q) {
0 > q && (q = 0);
8 < q && (q = 8);
q = J[q];
return 0 <= this ? Math.floor(this * q + .5000001) / q : Math.ceil(this * q
- .5000001) / q
}
;
Number.prototype.G = function(q) {
var k = this;
return q ? k | 1 : k & -2
}
;
Number.prototype.Vt = function(q) {
return !!(this & q)
}
;
Number.prototype.AH = function() {
return this.G(!this.Vt(1))
}
;
Number.prototype.jj = function(q) {
q = (isFinite(this) ? this : 0).toFixed(q).split(".");
q[0] = q[0].replace(/(\d)(?=(\d\d\d)+([^\d]|$))/g, "$1" + w.ju);
return q.join(".")
}
;
Number.prototype.Go = function() {
return 10 > this ? "0" + this : this.toString()
}
;
Number.prototype.jo = function(q) {
if (void 0 === q || 1 > q)
return Math.floor(this).toString();
var k = this.toFixed(8).split(".");
if (1 == k.length) {
k[1] = "";
for (var C = 0; C < q; C++)
k[1] += "0"
} else if (k[1].length > q)
k[1] = k[1].substr(0, q);
else
for (; k[1].length < q; )
k[1] += "0";
return k.join(".")
}
}
)();
Array.prototype.G || (Array.prototype.G = function(w, J) {
if (null == this)
throw new TypeError("Array.prototype.find called on null or undefined");
if ("function" !== typeof w)
throw new TypeError("predicate must be a function");
for (var q = Object(this), k = q.length >>> 0, C, g = 0; g < k; g++)
if (C = q[g],
w.call(J, C, g, q))
return C
}
);

You might also like