A very basic example of parseInt might involve just passing a string of a number as the first argument. The returned result will be a number rather than a string. When called parseInt will attempt to parse what is passed to it as a number that will be an integer value. So if for example I pass the string value of 42 the result will be a number with the value of 42 rather than a string of that number.
There is the question of how parseInt will treat a fraction of a number. With that said it would seem that parseInt will just cut the fraction part. If this is a problem then this would then be a reason why one would prefer to use one of the options for rounding numbers in place of using parseInt. In addition there is also the parseFloat method also that will not do that of course.
There are a few reason why one might end up with a NaN value when using parseInt. One such reason why NaN might be the result is when it comes to strings that contain letters that are to be used with a certain radix, NaN can result if the proper radix is not given.
Be mindful of any characters that are not used at all for number values of any radix. If a char that is not part of a number is at then end of a string then the parseInt method will just ignore it, and work with any valid chars from the start of the string up to that index in the string. However if a string begins with a char that is not used even with the property radix for the rest of the values that will result in NaN. The parseInt method will not preform any kind of pattern matching for you, you will need to do that before hand.
There is also the nature of the max safe integer, when adding anything to that and going beyond the max safe int that too can result in unexpected results as well with parseInt.
The Number function can be used to convert a string to a number also. It is a way to explicitly declare the the value that is given to the number function is th be parsed as a number. However it will not parse to an integer, at least not my itself, so it would have to be used in conjunction with an additional method such as the Math.round method.