Skip to content

Instantly share code, notes, and snippets.

View dtstanley's full-sized avatar
🏠
Working from home

DT Stanley dtstanley

🏠
Working from home
  • Wilmington, DE
View GitHub Profile
@dtstanley
dtstanley / arrayCopyIIJS.js
Created June 9, 2017 14:14 — forked from anonymous/arrayCopyIIJS.js
arrayCopyIIJS created by dtstanley - https://repl.it/G9G7/215
function minusLastItem(array) {
var copyArray = array.pop();
return array;
}
function copyFirstHalf(array) {
var halfArrayLgth =array.length/2;
return array.slice(0, halfArrayLgth);
@dtstanley
dtstanley / arrayCopyIJS.js
Created June 9, 2017 13:39 — forked from anonymous/arrayCopyIJS.js
arrayCopyIJS created by dtstanley - https://repl.it/G9GV/149
function firstFourItems(array) {
copyArray = array.slice();
return copyArray.slice(0,4);
}
function lastThreeItems(array) {
copyArray = array.slice();
return copyArray.slice(-3);
@dtstanley
dtstanley / arrayLengthJS.js
Created June 9, 2017 13:20 — forked from anonymous/arrayLengthJS.js
arrayLengthJS created by dtstanley - https://repl.it/G9GS/143
function findLength(array) {
return array.length;
}
function accessLastItem(array) {
copyArray = array.slice();
return copyArray.pop();
}
@dtstanley
dtstanley / accessArrayJS.js
Created June 9, 2017 13:03 — forked from anonymous/accessArrayJS.js
accessArrayJS created by dtstanley - https://repl.it/G9GO/124
function accessFirstItem(array) {
return array[0];
}
function accessThirdItem(array) {
return array[2];
}
@dtstanley
dtstanley / arrayPushJS.js
Created June 8, 2017 22:02 — forked from anonymous/arrayPushJS.js
arrayPushJS created by dtstanley - https://repl.it/G9GI/180
function addToList(list, item) {
list.push(item);
return list;
}
/* From here down, you are not expected to
understand.... for now :)
@dtstanley
dtstanley / createArrayJS.js
Created June 8, 2017 21:35 — forked from anonymous/createArrayJS.js
createArrayJS created by dtstanley - https://repl.it/G9GB/166
function makeList(item1, item2, item3) {
var myArray =[item1, item2, item3];
return myArray;
}
/* From here down, you are not expected to
understand.... for now :)
@dtstanley
dtstanley / index.css
Created June 8, 2017 14:16 — forked from anonymous/index.css
error_js created by dtstanley - https://repl.it/Ggcp/180
* {
box-sizing: border-box;
}
main {
padding: 50px 20px;
}
.error-report {
color: red;
@dtstanley
dtstanley / index.css
Last active June 8, 2017 13:41 — forked from anonymous/index.css
trafficlght_js created by dtstanley - https://repl.it/Ggbk/171
* {
box-sizing: border-box;
}
main {
padding: 50px 20px;
}
.traffic-light-box {
width: 100px;
@dtstanley
dtstanley / index.css
Created June 8, 2017 13:37 — forked from anonymous/index.css
trafficlght_js created by dtstanley - https://repl.it/Ggbk/171
* {
box-sizing: border-box;
}
main {
padding: 50px 20px;
}
.traffic-light-box {
width: 100px;
@dtstanley
dtstanley / isDiv_js.js
Created June 8, 2017 04:49 — forked from anonymous/isDiv_js.js
isDiv_js created by dtstanley - https://repl.it/G9Ec/157
function isDivisible(divisee, divisor) {
return (divisee%divisor===0)
}
/* From here down, you are not expected to
understand.... for now :)
Nothing to see here!