Skip to content
This repository has been archived by the owner on Feb 2, 2021. It is now read-only.

the first indice of an array is 0 not 1 #2

Closed
kpreid opened this issue Apr 16, 2015 · 1 comment
Closed

the first indice of an array is 0 not 1 #2

kpreid opened this issue Apr 16, 2015 · 1 comment

Comments

@kpreid
Copy link
Contributor

kpreid commented Apr 16, 2015

Original issue 2 created by sylvain.pointeau on 2007-10-19T14:04:29.000Z:

in JSON.js
method serialize
for an array
the loop should begin at 0

        function serialize(value) {

....
for (i = 0; i < len; i += 1) { <---- here
v = filter(value, i);
if (v !== undefined) {
if (needComma) {
out.push(',');
} else {

Cheers,
Sylvain Pointeau

@kpreid
Copy link
Contributor Author

kpreid commented Apr 16, 2015

Comment #1 originally posted by erights on 2007-10-21T01:32:57.000Z:

Fixed. The 1 index was a remnant from earlier logic that dealt with the needComma
issue a different way. Thanks for catching this!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant