forked from devleague/array-methods
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
116 additions
and
206 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,43 +1,12 @@ | ||
/** | ||
* | ||
* Using the push() method | ||
* | ||
* Declare a new function to be exported named `pushToArray` | ||
* This function has two parameters: | ||
* @param {Array} | ||
* @param {Any} | ||
* | ||
* @return {Array} Array with the value appended to the end | ||
*/ | ||
var genericNumberArray = [1, 2, 3, 4, 5]; | ||
var colors = ['Blue', 'Red', 'Yellow', 'Charlie']; | ||
var scrambledWords = ['win', 'the', 'for', 'burritos']; | ||
var phoneNumber = [9, 0, 3, 5, 7, 6, 8]; | ||
var orderQueue = [{ takeOut: 'Ice Cream' }, { takeOut: 'Medium Salad'}, { takeOut: 'Burger'}]; | ||
var mixedNums = [5, 81, 40, 4, 805, 10, 76, 21, 3, 2, 7, 1, 7]; | ||
var mixedWords = ['Dont', 'You', 'Forget', 'About', 'Me']; | ||
var fruitCollection = ['Apple', 'Scissors', 'Pug', 'Lady Bug', 'Banana', 'Pear']; | ||
var gemBox = ['Ruby', 'Diamond', 'Diamond', 'Emerald', 'Moonstone', 'Pizza', 'Sneaker', 'Sapphire', 'Baby', 'Jeans', 'Soda Can', 'Boat']; | ||
var upToTen = [1, 2, 9, 10]; | ||
|
||
/** | ||
* | ||
* Using the pop() method | ||
* | ||
* Declare a new function to be exported named `popArray` | ||
* This function has one parameter: | ||
* @param {Array} | ||
* | ||
* @return {Any} Element that was removed | ||
*/ | ||
|
||
/** | ||
* | ||
* Using the reverse() method | ||
* | ||
* Declare a new function to be exported named `reverseArray` | ||
* This function has one parameter: | ||
* @param {Array} | ||
* | ||
* @return NONE | ||
*/ | ||
|
||
/** | ||
* | ||
* Using the shift() method | ||
* | ||
* Declare a new function to be exported named `shiftArray` | ||
* This function has one parameter: | ||
* @param {Array} | ||
* | ||
* @return {Any} Element that was removed | ||
var brownOnly = ["brown", "brownish", "ad8fy7iuhj23nrsf", 9813, {}, undefined, "brown"]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<!doctype html> | ||
<html class="no-js" lang=""> | ||
<head> | ||
<meta charset="utf-8"> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | ||
<title>JavaScript Array Methods</title> | ||
<meta name="viewport" content="width=device-width, initial-scale=1"> | ||
|
||
<link rel="stylesheet" href="lib/css/mocha.css"> | ||
</head> | ||
<body> | ||
<div id="mocha"></div> | ||
<script src="lib/js/mocha.js"></script> | ||
<script src="lib/js/chai.js"></script> | ||
<script src="lib/js/sinon-chai.js"></script> | ||
<script src="lib/js/sinon.js"></script> | ||
<script>mocha.setup('bdd');</script> | ||
<script src="arrayMethods.js" data-cover></script> | ||
<script src="test/arrayMethods-spec.js"></script> | ||
<script>mocha.run();</script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters