Skip to content
Myr

Document `length` for numbers and bools (#2625)

Before adoption: this commit came in with the history the project adopted, so no landing records it.

This was added in ae7a042876130c471dce28a4396abc215192eaa9 but not explicitly documented.

authored by Alex Jurkiewicz · committed by GitHub · parent 9a59042 · Browse files · 2 files+12 added−4 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+12 added−4 removed

  • other:+12 added−4 removed

2 files+12 added−4 removed

modified:docs/content/manual/v1.6/manual.yml+6 added-2 removed
734 unmodified lines
735 - The length of a **string** is the number of Unicode736 codepoints it contains (which will be the same as its737 JSON-encoded length in bytes if it's pure ASCII).738739 - The length of a **number** is its absolute value.740741 - The length of an **array** is the number of elements.742743 - The length of an **object** is the number of key-value pairs.744745 - The length of **null** is zero.746747 - It is an error to use `length` on a **boolean**.748749 examples:750 - program: '.[] | length'747 input: '[[1,2], "string", {"a":2}, null]'748 output: [2, 6, 1, 0]751 input: '[[1,2], "string", {"a":2}, null, -5]'752 output: [2, 6, 1, 0, 5]753754755 - title: "`utf8bytelength`"756 body: |
2546 unmodified lines
modified:docs/content/manual/manual.yml+6 added-2 removed
812 unmodified lines
813 - The length of a **string** is the number of Unicode814 codepoints it contains (which will be the same as its815 JSON-encoded length in bytes if it's pure ASCII).816817 - The length of a **number** is its absolute value.818819 - The length of an **array** is the number of elements.820821 - The length of an **object** is the number of key-value pairs.822823 - The length of **null** is zero.824825 - It is an error to use `length` on a **boolean**.826827 examples:828 - program: '.[] | length'825 input: '[[1,2], "string", {"a":2}, null]'826 output: [2, 6, 1, 0]829 input: '[[1,2], "string", {"a":2}, null, -5]'830 output: [2, 6, 1, 0, 5]831832833 - title: "`utf8bytelength`"834 body: |
2597 unmodified lines