Why is the out NaN, if I put semicolons after brackets?

I’m not sure what this operation is called, but it’s used for finding particular characters in a string.

Why does this work?

one[1] two[2] three[3] four[4] five[5];

But not this because the output is NaN

one[1]; two[2]; three[3]; four[4]; five[5];

It will be easy for us to figure out what is happening if you send the code

1 Like