typescript push elements into an array in roundrobin fashion
问题 I have an array: public roundRobinMonths: any=['Jan', 'Feb', 'Mar', 'Apr', 'Mai', 'Jun', 'July', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']; and another empty array: public userTimeline: any=[]; My user will select a month from a datepicker and if he selects say September then I want to add months starting from Oct until Sep in my userTimeline array i.e. Oct, Nov,..., Apl, Mai,..., Aug, Sep I receive in my component index for a month that user selects i.e. 0, 1,.., 11. I tried running a for loop like