mirror of
https://github.com/stedolan/jq.git
synced 2024-05-11 05:55:39 +00:00
Add break builtin for foreach
This commit is contained in:
@@ -1844,8 +1844,7 @@ sections:
|
||||
This is mostly useful only for constructing `reduce`- and
|
||||
`limit`-like functions. But it is much more general, as it
|
||||
allows for partial reductions (see the example below), as well
|
||||
as breaking out of the "loop" with `empty`, or even `error(x)`
|
||||
if there's a try/catch around the foreach.
|
||||
as breaking out of the "loop" with `break`.
|
||||
|
||||
examples:
|
||||
- program: '[foreach .[] as $item
|
||||
|
||||
Reference in New Issue
Block a user