Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions 02-functions/practice.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
// (example) Write a function that accepts two number arguments and adds them
// together.
// Write a function that accepts two number arguments and returns their sum
var add = function () {
};


// Create a function that takes in a cost and a quantity and outputs the total
// Create a function that takes in a cost and a quantity and returns the total
// pre-tax cost for that quantity of items at the given price. For example
//
// var preTaxTotal = totalCost(5, 5.99); // 5 items at 5.99
Expand Down
6 changes: 3 additions & 3 deletions 05-loops/practice.js
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ var isPrime = function () {


// Using the `isPrime` function, write a function that accepts a number as
// input sums all the primes smaller than that number.
// input sums all the primes smaller or equal to that number.
//
// sumPrimesUpTo(100);
// //=> 1060
Expand All @@ -176,7 +176,7 @@ var sumPrimesUpTo = function () {


// Using the `isPrime` function, write a function that takes in a
// positive integer, n, and returns the first n numbers.
// positive integer, n, and returns the sum of the first n prime numbers.
//
// sumOfFirstNPrimes(10);
// //=> 129
Expand Down Expand Up @@ -214,7 +214,7 @@ var sumOfFirstNPrimes = function () {
// //=> false
//
// Let's start by writing a function to remove all non-letter characters
// from the input.
// from the input. If the input is not a string, throw an error.
//
// removeNonLetters("A man, a plan, a canal, Panama");
// //=> AmanaplanacanalPanama
Expand Down
7 changes: 4 additions & 3 deletions 06-arrays/practice.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Write a function called `containsTwice` that accepts a number and an array,
// and returns `true` if that number appears in the array twice, and `false`
// Write a function called `containsTwice` that accepts an element and an array,
// and returns `true` if that element appears in the array twice, and `false`
// otherwise.
//
// containsTwice(5, [1, 2, 3, 4, 5]);
Expand Down Expand Up @@ -103,7 +103,8 @@ var containsAnyTwice = function () {
// In the previous problem, we determined whether or not an array contains any
// of a list of values exactly twice. In this problem, we'll actually return
// those values appearing twice. Create a new function that returns an array of
// only the values from the first array that appear twice in the second array.
// only the values that appear twice in the array.
//
//
// For this problem, you'll create a new array, and you'll use its `push`
// function to add elements to the end. You'll most likely want to use the
Expand Down