nodeselector
5/18/2018 - 9:16 PM

ternary.js

// returns an array that indicates wheter list[n] is a minor or adult
let list = [14, 10, 48, 29, 18, 21],
    status = (a) => {
        return (a >= 18) ? 'adult' : 'minor';
    };

console.log(list.map(x => status(x)));