Calculate the income tax for an income of $70k by adhering to the rules below: First $10k: 0 = 0 Next $10k: 10 = 10 Following $10k: 20 = 20 Remaining amount: 30 in JavaScript
![](https://cdn-icons-png.flaticon.com/512/5968/5968292.png)
JavaScript
🤖 Code Explanation
}
The code calculates the tax for an income. If the income is more than 10000, the tax is 10%. If the income is more than 20000, the tax is 20%. Otherwise, the tax is 30%.
![](https://cdn-icons-png.flaticon.com/512/5968/5968292.png)
More problems solved in JavaScript
![](https://cdn-icons-png.flaticon.com/512/5968/5968292.png)
![](https://cdn-icons-png.flaticon.com/512/5968/5968292.png)
![](https://cdn-icons-png.flaticon.com/512/5968/5968292.png)
![](https://cdn-icons-png.flaticon.com/512/5968/5968292.png)
![](https://cdn-icons-png.flaticon.com/512/5968/5968292.png)
![](https://cdn-icons-png.flaticon.com/512/5968/5968292.png)
![](https://cdn-icons-png.flaticon.com/512/5968/5968292.png)
![](https://cdn-icons-png.flaticon.com/512/5968/5968292.png)
![](https://cdn-icons-png.flaticon.com/512/5968/5968292.png)
![](https://cdn-icons-png.flaticon.com/512/5968/5968292.png)
![](https://cdn-icons-png.flaticon.com/512/5968/5968292.png)
![](https://cdn-icons-png.flaticon.com/512/5968/5968292.png)
![](https://cdn-icons-png.flaticon.com/512/5968/5968292.png)
![](https://cdn-icons-png.flaticon.com/512/5968/5968292.png)
![](https://cdn-icons-png.flaticon.com/512/5968/5968292.png)
![](https://cdn-icons-png.flaticon.com/512/5968/5968292.png)
![](https://cdn-icons-png.flaticon.com/512/5968/5968292.png)
![](https://cdn-icons-png.flaticon.com/512/5968/5968292.png)
![](https://cdn-icons-png.flaticon.com/512/5968/5968292.png)