Skip to content

Instantly share code, notes, and snippets.

View goldtreefrog's full-sized avatar

Margaret Blauvelt goldtreefrog

View GitHub Profile
@goldtreefrog
goldtreefrog / u2l4p6-arrays-and-loops-drills
Last active October 20, 2017 06:39
Arrays and Loops Drills
https://repl.it/Mwca - Maximum and Minimum (u2l4p6-max-min.js)
https://repl.it/MwdS/0 - Average (u2l4p6-average.js)
https://repl.it/Mwd7/2 - Fizzbuzz (u2l4p6-fizzbuzz.js)
@goldtreefrog
goldtreefrog / u2l4p4-array-method-drills
Created October 20, 2017 01:38
Array Method Drills
https://repl.it/MwHo - Copying portions of arrays using .slice(). (u2l4p4-array-copying-1)
https://repl.it/MwID/1 - More practice copying arrays. (u2l4p4-array-copying-2)
https://repl.it/MwJl - Squares in new array made using .map() method. (u2l4p4-squares-with-map)
https://repl.it/MwJ3 - Sort an array of numbers in reverse order. (u2l4p4-sort)
https://repl.it/MwJB - Filter an array according to word length. (u2l4p4-filter)
https://repl.it/MwJN - Find the first number in an array that is divisible by 5. (u2l4p4-find)
@goldtreefrog
goldtreefrog / u2l4p2-arrays-basic-drills
Created October 19, 2017 15:48
Array Basic Drills
https://repl.it/MuMh - Create an array from parameters passed into a function. (u2l4p2-creating-arrays)
https://repl.it/MuOt - Add an item to the end of an array using "push". (u2l4p2-adding-arrays)
https://repl.it/MuQQ - Return first and third items from within an array. (u2l4p2-accessing-array-items)
https://repl.it/MuRi - Functions to 1) return length of array and 2) return last item of array. (u2l4p2-array-length-access)
https://repl.it/MuCe/1
https://repl.it/MuEC/1
'use strict';
function computeArea(width, height) {
return width * height;
}
let n1 = prompt("First number?");
let n2 = prompt("Second number?");
console.log("Area is " + computeArea(n1,n2));
'use strict';
function wisePerson(wiseType, whatToSay) {
return `A wise ${wiseType} once said: "${whatToSay}".`
}
console.log(wisePerson("goat","Hello world"));
function shouter(whatToShout) {
return whatToShout.toUpperCase() + "!!!";