AIγ«θžγ„γŸγ‚‰reduceでめっけゃゴネゴネ頑弡ると出ζ₯γ‚‹γ‚ˆγ£γ¦

jq 'reduce .[] as $x (0; if $x >= 2 then . + $x else . end)' #=> 5

γΎγγ“γ‚Œγ―ζ›ΈγγŸγγͺいわγͺ…

Reply to this note

Please Login to reply.

Discussion

echo '[1,2,3]' | jq 'reduce .[] as $x (0; if $x >= 2 then . + $x else . end)' #=> 5