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
function minusLastItem(array) { | |
var copyArray = array.pop(); | |
return array; | |
} | |
function copyFirstHalf(array) { | |
var halfArrayLgth =array.length/2; | |
return array.slice(0, halfArrayLgth); |
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
function firstFourItems(array) { | |
copyArray = array.slice(); | |
return copyArray.slice(0,4); | |
} | |
function lastThreeItems(array) { | |
copyArray = array.slice(); | |
return copyArray.slice(-3); |
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
function findLength(array) { | |
return array.length; | |
} | |
function accessLastItem(array) { | |
copyArray = array.slice(); | |
return copyArray.pop(); | |
} | |
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
function accessFirstItem(array) { | |
return array[0]; | |
} | |
function accessThirdItem(array) { | |
return array[2]; | |
} | |
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
function addToList(list, item) { | |
list.push(item); | |
return list; | |
} | |
/* From here down, you are not expected to | |
understand.... for now :) |
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
function makeList(item1, item2, item3) { | |
var myArray =[item1, item2, item3]; | |
return myArray; | |
} | |
/* From here down, you are not expected to | |
understand.... for now :) | |
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
* { | |
box-sizing: border-box; | |
} | |
main { | |
padding: 50px 20px; | |
} | |
.error-report { | |
color: red; |
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
* { | |
box-sizing: border-box; | |
} | |
main { | |
padding: 50px 20px; | |
} | |
.traffic-light-box { | |
width: 100px; |
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
* { | |
box-sizing: border-box; | |
} | |
main { | |
padding: 50px 20px; | |
} | |
.traffic-light-box { | |
width: 100px; |
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
function isDivisible(divisee, divisor) { | |
return (divisee%divisor===0) | |
} | |
/* From here down, you are not expected to | |
understand.... for now :) | |
Nothing to see here! |