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

    let { value, weight } =
        if values.empty() {
            { value: 0, weight: 1.0 }
        } else {
            { value: values[0], weight: 1 / values.len() }
        }
Using JS style object expansion, instead of tuple expansion.


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

Search: