Skip to content

Commit 963b26e

Browse files
selwynjacob90ajpiano
authored andcommitted
JavaScript 101/Arrays: Correct the method name from pop to push under shift queue example. Fixes jquery#215
1 parent 332c463 commit 963b26e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

page/javascript-101/arrays.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ var wholeArray = myArray.concat( myOtherArray );
113113
var myArray = [ "hello", "world", "!" ];
114114
115115
console.log( myArray.join(" ") ); // "hello world !";
116-
console.log( myArray.join() ); // "hello,world,!"
116+
console.log( myArray.join("") ); // "hello,world,!"
117117
console.log( myArray.join("") ); // "helloworld!"
118118
console.log( myArray.join("!!") ); // "hello!!world!!!";
119119
```
@@ -146,10 +146,10 @@ myArray.reverse();
146146

147147
### `.shift`
148148

149-
Removes the first element of an array. With `.pop` and `.shift`, you can recreate the method of a [queue](http://en.wikipedia.org/wiki/Queue_(data_structure)):
149+
Removes the first element of an array. With `.push` and `.shift`, you can recreate the method of a [queue](http://en.wikipedia.org/wiki/Queue_(data_structure)):
150150

151151
```
152-
// queue with shift() and pop()
152+
// queue with shift() and push()
153153
var myArray = [];
154154
155155
myArray.push( 0 ); // [ 0 ]

0 commit comments

Comments
 (0)