diff --git a/page/javascript-101/arrays.md b/page/javascript-101/arrays.md index 45ccfcb6..7977aa01 100644 --- a/page/javascript-101/arrays.md +++ b/page/javascript-101/arrays.md @@ -113,7 +113,7 @@ var wholeArray = myArray.concat( myOtherArray ); var myArray = [ "hello", "world", "!" ]; console.log( myArray.join(" ") ); // "hello world !"; -console.log( myArray.join() ); // "hello,world,!" +console.log( myArray.join(",") ); // "hello,world,!" console.log( myArray.join("") ); // "helloworld!" console.log( myArray.join("!!") ); // "hello!!world!!!"; ``` @@ -146,10 +146,10 @@ myArray.reverse(); ### `.shift` -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)): +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)): ``` -// queue with shift() and pop() +// queue with shift() and push() var myArray = []; myArray.push( 0 ); // [ 0 ]