-
Notifications
You must be signed in to change notification settings - Fork 56
Expand file tree
/
Copy pathWeek03ArraysAndFunctions.js
More file actions
55 lines (33 loc) · 1.61 KB
/
Week03ArraysAndFunctions.js
File metadata and controls
55 lines (33 loc) · 1.61 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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
//
// Copyright (c) 2023 Promineo Tech
// Author: Promineo Tech Academic Team
// Subject: Arrays & Functions Lab
// JavaScript Week 03 Lab
//
let array1 = [1, 5, 6, 9, 10, 14];
// print the 3rd element in array1
// print the last element in array1
// add 16 and 3 to array1
// sort the array, then print the 3rd element again
// did it change?
// create a variable called myTodoList that holds an empty array
// add three todo items to the array using a built-in array method
// remove the second item in the array
// create another array, yourTodoList, and add two todo items
// create another array, ourTodoList
// combine myTodoList and yourTodoList into ourTodoList
// sort the following array from Z-A
// create a function called reverse that takes in parameter
// this function will return the opposite of whatever is passed in
// if its a boolean, return the opposite
// if its a number, or a string, return the reverse (i.e. 1234 becomes 4321, Name becomes emaN)
// if its an array, return the reversed array with each element reversed
// create a function called addingMachine that will add all passed numbers and return the total
// Note: you don't know how many numbers will be passed
// You just signed a contract as an estimator for a restoration company.
// Your contract states that you take home 10% of the profits on the first $100,000
// 20% on the next $400,000
// 35% on the next $500,000
// 40% on all profits above $1,000,000
// create a function that will allow you to check how much of a bonus you make
// the function should take in two variables as arguments, grossInvoiced and profitMargin