Overwrite Math.log function - Node.js Math

Node.js examples for Math:Log

Description

Overwrite Math.log function

Demo Code


// overwrite Math.log function
exports.log = (function () {
    var log = Math.log;
    return function (n, base) {
        return log(n) / (base ? log(base) : 1);
    };//from w w  w .  ja v  a2 s.  c o  m

Related Tutorials