const pipe = (fn,...fns) => (...args) => !fns.length ? fn(...args) : pipe(...fns)(fn(...args));
const getKittens =
cats => cats.filter(cat => cat.months < 7);
const namesToList =
listOfObjects => listOfObjects.map(ob => ob.name);
const getKittenNames = pipe(getKittens, namesToList);
const cats = [
{ name: 'Mojo', months: 84 },
{ name: 'Mao-Mao', months: 34 },
{ name: 'Waffles', months: 4 },
{ name: 'Pickles', months: 6 }
];
const kittenNames = getKittenNames(cats);
console.log(kittenNames);