Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Assume input is an array you can do it several ways depending on what you want:

    # output each value in the array separately 
    .[]

    # output each value but transform it in some way
    .[] | . * 2


    # map each value into a new array
    map(. * 2) 

    # same as above but manual iterate/collect
    [.[] | . * 2]


Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: