nth root of a number in javaScript
Often I end up using Math.sqrt in projects whenever I need to get the square root of a number. However what if I want the nth root of a number? Such as the cubed root of a number, or any other degree beyond of that of just the number 2 that is what I am set with when using the Math sqrt method. I can not say that I end up having to use this kind of method that often, but still there does not seem to be a built in mMath object method for it.
Well in this post I will be going over a quick example of how to go about working out a basic nth root method with just plain old javaScript by itself.
1  nth root and math pow
One solution is to use the Math.pow method to get the nth root of a given root number and degree.
This works by just passing the root number as the base for Math.pow, and then diving 1 by the degree number to get the exponent argument for Math.pow like so.


2  Conclusion
I can not say that I end up using this often in projects, but it is something that I think about now and then. If I find out some other ways to go about doing that as well as some actual use case example i will be sure to update this post.