Chuong Dao - 1 year ago 116

Javascript Question

I am currently learning Javascript and here is my struggle with my homework, hope you guys can help me with this one:

`futureInvestment = investmentAmount * (1 + monthlyInterestRate)^numberOfYears*12`

How to implement this equation? Thanks

Recommended for you: Get network issues from **WhatsUp Gold**. **Not end users.**

Answer Source

Use the `Math.pow()`

function.

To calculate `x^y`

say `Math.pow(x, y)`

. For example:

```
Math.pow(2, 4) // returns 16
Math.pow(13, 3) // returns 2197
```

*(Since you've mentioned that you're working on homework I'll give you a chance to figure out for yourself how to apply Math.pow() to your particular calculation rather than just giving you the final answer immediately.)*

Recommended from our users: **Dynamic Network Monitoring from WhatsUp Gold from IPSwitch**. ** Free Download**