logarithm formula javascript code example Example: calculate log in javascript var value = Math.log(2);