const getCard = button => $(`#card${button.id.match(/\d+/).pop()}`);
$('[id^="button"]').hover(
e => getCard(e.target).fadeIn(),
e => getCard(e.target).fadeOut(),
);
const $buttons = $('[id^=button]').hover(function(e) {
this.eq($buttons.index(e.target))[e.type === 'mouseenter' ? 'fadeIn' : 'fadeOut']();
}.bind($('[id^=card]')));