Hacker News new | ask | show | jobs
by mishoo 3161 days ago
What's wrong with:

    return {
        labels: data.items.map(function(value){
            return {
                type: "label",
                value: value > 10 ? value : value * 100
            };
        })
    };
I hope your project does not get too popular.
1 comments

Even cleaner with ES6.

return { labels: data.items.map(value => { type: "label", value: value > 10 ? value : value * 100 }) };