そもそもfunc(A);func(B);で良くねとは思うけど

function func(...args) {
for (let arg of args) {
// $('#hoge-' + arg).〜;
// $('#hage-' + arg).〜;
}
}