get log in javascript code example Example 1: calculate log in javascript var value = Math.log(2); Example 2: log javascript console.log(variable)