-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFunctions.js
More file actions
66 lines (50 loc) · 1.21 KB
/
Copy pathFunctions.js
File metadata and controls
66 lines (50 loc) · 1.21 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
// Parameterized functions
// thee are the functions that have no parameterzw
// example 1
function greeeting(){
console.log("Hello how are you");
}
greeeting();
greeeting();
// the two times the function is called
// Parameterized function
// The function thta need parameters to work
// example 1
function add (num1 , num2){
result = num1 + num2;
console.log(result);
}
add(23,45);
// example 2
function multiply (num1 , num2){
result = num1 * num2;
console.log(result);
}
multiply(23,45);
// Return function
// The function thta need parameters to work
// example 1
function add (num1 , num2){
return num1 + num2;
}
let result = add(23,45);
console.log(result)
// example 2
function multiply (num1 , num2){
return num1 * num2;
}
let result = multiply(23,45);
console.log(result)
// In these two functions the return is used instead of console.log through these the
// when a function is called they automatically show the result
// Built-in functions
// like MATH.max , alert
function remainder(){
alert("get ready for school");
}
remainder();
// MATH.max
function greater(){
console.log(Maht.max(34,45));
}
greater();