forked from AdamMomen/warmUp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwarmUp7.js
More file actions
40 lines (26 loc) · 636 Bytes
/
Copy pathwarmUp7.js
File metadata and controls
40 lines (26 loc) · 636 Bytes
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
// 1-using + operator combine your partner first and last name .
function plusOperator(first, last){
return first+ " " + last;
}
// 2-find if the number 13 is a multiple of 3 or not.
function isMultipleOfThree(num){
if (num%3===0){
return true;
}else{
return false;
}
}
isMultipleOfThree(13);
// 3-calculate the average age of the follwing ages [13,14,13,15,16,17,19,13,16,15]
function average (arr) {
var acc=0;
for (var i = 0; i < arr.length; i++) {
acc=acc+arr[i]
}
return acc/arr.length;
}
// 4-calculate your age in seconds.
function ageInSeconds(age){
return age*365.25*24*60*60
}
// your code is here