SoFunction
Updated on 2025-04-14

Prototype Number Object Learning


(, (function() {

//Return to hexadecimal color
function toColorPart() {
return (2, 16);
}

//Return the next consecutive value
function succ() {
return this + 1;
}

//Execute a certain operation continuously
function times(iterator, context) {
$R(0, this, true).each(iterator, context);
return this;
}

//Return a fixed length string, add 0 in the previous section
function toPaddedString(length, radix) {
var string = (radix || 10);
return '0'.times(length - ) + string;
}

function toJSON() {
return isFinite(this) ? () : 'null';
}

function abs() {
return (this);
}

function round() {
return (this);
}

function ceil() {
return (this);
}

function floor() {
return (this);
}

return {
toColorPart: toColorPart,
succ: succ,
times: times,
toPaddedString: toPaddedString,
toJSON: toJSON,
abs: abs,
round: round,
ceil: ceil,
floor: floor
};
})());