

Array parseInt() bug or JavaScript bad parts? - suramya

parseInt(array[0]) does not give int value, instead it is NaN.
======
coldtea
Welcome to the world of programming. Here are some pointers.

1) Before blaming "Javascript bad parts" consider if you know the language
that well in the first place.

2) The way you stated the problem does not make sense, and does not provide
enough context.

3) What's "array"? If you refer to some specicic array, we need to know what
you have in it. It could indeed be NaN.

4) If you're trying to say this happens with all arrays, then you're wrong.
Here's a counter example from v8:

a = [1,2,3] console.log(parseInt(a[0])) => 1

5) If the array is not initialized (empty), then of course parseInt(array[0])
is NaN, since array[0] is undefined.

