-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathExercise.js
More file actions
38 lines (28 loc) · 1.01 KB
/
Copy pathExercise.js
File metadata and controls
38 lines (28 loc) · 1.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
/**
*
*/
var FIX_ME = 0;
var answers = [];
// Replace the FIX_ME variable with the correct answer to make the expression true
answers[0] = "100" === FIX_ME;
answers[1] = 85 % FIX_ME === 4;
answers[2] = !(1 < 2 && 4 !== 5) || undefined === FIX_ME;
answers[3] = FIX_ME ? true : false;
var mini_array = [1, 2, 3];
answers[4] = mini_array[2] === FIX_ME;
answers[5] = mini_array.length === FIX_ME;
var mini_object = {name: apple, color: red, edible: true};
answers[6] = mini_object[FIX_ME] === 'red';
answers[7] = mini_object.length === FIX_ME;
// Write a function that accepts two numbers are returns their sum
// Modify the function to accept a third number
function addition(num1, num2) {
}
// Write a function that accepts two numbers and adds them together if they are even
// or multiplies them if they are odd
function fun_with_math(num1, num2) {
}
// Write the ForEach function that accepts a collection (array or object) and performs
// callback function on each item in it
function ForEach(collection, callback) {
}