Skip to content

Commit 3a85a7c

Browse files
committed
fixed solution for array-methods exercise 1b
1 parent bc869e4 commit 3a85a7c

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

  • src/sections/04-arrays-and-two-pointers/05-array-methods

src/sections/04-arrays-and-two-pointers/05-array-methods/solution.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,7 @@ function managePerformanceQueue(initialLineup, newOpeners, finishedActs) {
1717
let lineup = [...initialLineup];
1818

1919
// Add new opening acts to the beginning
20-
newOpeners.forEach(opener => {
21-
lineup.unshift(opener);
22-
});
20+
lineup.unshift(...newOpeners);
2321

2422
// Remove finished acts from the beginning
2523
for (let i = 0; i < finishedActs; i++) {

0 commit comments

Comments
 (0)