mirror of
https://github.com/nushell/nushell.git
synced 2025-08-13 22:48:25 +02:00
Update some examples and docs (#4682)
* Update some examples and docs * Update now.rs * Update date_now.md Co-authored-by: JT <547158+jntrnr@users.noreply.github.com>
This commit is contained in:
@ -28,6 +28,11 @@ Iterate over each element, keeping only values that succeed
|
||||
> [1 2 3] | each { |it| if $it == 2 { echo "found 2!"} }
|
||||
```
|
||||
|
||||
Iterate over each element, print the matching value and it's index
|
||||
```shell
|
||||
> [1 2 3] | each -n { |it| if $it.item == 2 { echo $"found 2 at ($it.index)!"} }
|
||||
```
|
||||
|
||||
Iterate over each element, keeping all results
|
||||
```shell
|
||||
> [1 2 3] | each --keep-empty { |it| if $it == 2 { echo "found 2!"} }
|
||||
|
Reference in New Issue
Block a user