Skip to content

Commit

Permalink
[Docs] add empty object and array values example.
Browse files Browse the repository at this point in the history
  • Loading branch information
up9cloud authored and ljharb committed Jan 6, 2017
1 parent 5f27353 commit 0adcf3e
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,16 @@ Empty strings and null values will omit the value, but the equals sign (=) remai
assert.equal(qs.stringify({ a: '' }), 'a=');
```

Key with no values (such as an empty object or array) will return nothing:

```javascript
assert.equal(qs.stringify({ a: [] }), '');
assert.equal(qs.stringify({ a: {} }), '');
assert.equal(qs.stringify({ a: [{}] }), '');
assert.equal(qs.stringify({ a: { b: []} }), '');
assert.equal(qs.stringify({ a: { b: {}} }), '');
```

Properties that are set to `undefined` will be omitted entirely:

```javascript
Expand Down

0 comments on commit 0adcf3e

Please sign in to comment.