짧고 간결한 소스코드 만들기..

var arrow1;

var arrow2;

var arrow3;

var arrow4;

var arrow5;

arrow1 = new Sequence($(".arrow1"), { source: “images/arrow”, name: “arrow”, totalFrams: 10});

arrow2 = new Sequence($(".arrow2"), { source: “images/arrow”, name: “arrow”, totalFrams: 10});

arrow3 = new Sequence($(".arrow3"), { source: “images/arrow”, name: “arrow”, totalFrams: 10});

arrow4 = new Sequence($(".arrow4"), { source: “images/arrow”, name: “arrow”, totalFrams: 10});

arrow5 = new Sequence($(".arrow5"), { source: “images/arrow”, name: “arrow”, totalFrams: 10});

arrow1.hide();

arrow2.hide();

arrow3.hide();

arrow4.hide();

arrow5.hide();

이런 코드를 모듈화 시켜서 포문으로 돌리고싶은데 어렵네요…ㅠㅠ

function arrow(name) {
    const sequence = new Sequence($(name), { source: “images/arrow”, name: “arrow”, totalFrams: 10});
    sequence.hide();
}

배열을 쓸 수도 있지 않을까 생각합니다.

이런식은 어때요?

var arrow;
for(var i=1;i<5;i++)
{
    arrow = new Sequence($(".arrow"+i), { source: “images/arrow”, name: “arrow”, totalFrams: 10});
    arrow.hide();
}