give me JavaScript code to calculate pi