-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
46 lines (32 loc) · 728 Bytes
/
script.js
File metadata and controls
46 lines (32 loc) · 728 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
41
42
43
44
45
46
function logger(text) {
console.log(text)
}
/* radical function */
function radicalNumbers (a){
let rn = Math.sqrt(a);
return rn;
}
logger(radicalNumbers(4))
/* square rooting function */
function squareNumbers (b){
let sn = b * b;
return sn;
}
logger(squareNumbers(10))
/* centimeter to inch function */
function toCentimeter(inch) {
let tc = 0;
tc = inch * 2.54;
return tc;
}
logger(toCentimeter(5))
/* able to buy alcohol function */
/* just trying boolean with the use of w3 */
function sellingAlcohol (a){
if (a >= 18) {
return text = "Can buy alcohol";
}
else if (a < 18)
return text ="Too young to buy alcohol boohoo";
}
logger(sellingAlcohol(5))