Skip to content

Commit 0adcf3e

Browse files
up9cloudljharb
authored andcommitted
[Docs] add empty object and array values example.
1 parent 5f27353 commit 0adcf3e

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

README.md

+10
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,16 @@ Empty strings and null values will omit the value, but the equals sign (=) remai
278278
assert.equal(qs.stringify({ a: '' }), 'a=');
279279
```
280280

281+
Key with no values (such as an empty object or array) will return nothing:
282+
283+
```javascript
284+
assert.equal(qs.stringify({ a: [] }), '');
285+
assert.equal(qs.stringify({ a: {} }), '');
286+
assert.equal(qs.stringify({ a: [{}] }), '');
287+
assert.equal(qs.stringify({ a: { b: []} }), '');
288+
assert.equal(qs.stringify({ a: { b: {}} }), '');
289+
```
290+
281291
Properties that are set to `undefined` will be omitted entirely:
282292

283293
```javascript

0 commit comments

Comments
 (0)