Skip to content

Commit 61f92a1

Browse files
authored
Merge pull request #235 from amid11/patch-1
Fix for replacing the middle item in an Array
2 parents 4ab4223 + 70d1d87 commit 61f92a1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

1-js/05-data-types/04-array/2-create-array/solution.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
```js run
44
let styles = ["Jazz", "Blues"];
55
styles.push("Rock-n-Roll");
6-
styles[(styles.length + 1) / 2] = "Classics";
6+
styles[Math.floor((styles.length - 1) / 2)] = "Classics";
77
alert( styles.shift() );
88
styles.unshift("Rap", "Reggie");
99
```

0 commit comments

Comments
 (0)