forked from DouglasHdezT/JavaScript_NodeCourse
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathExample2.js
More file actions
41 lines (34 loc) · 750 Bytes
/
Example2.js
File metadata and controls
41 lines (34 loc) · 750 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
/**
* Sintax variations
*/
//No parameters
const af1 = () => {
console.log("I don't recieved any parameter");
}
//One parameter
const af2 = name => {
console.log("I recieved this name: " + name);
}
//Many parameters
const af3 = (name, age, gender) => {
console.log(`Name: ${name}`);
console.log(`Age: ${age}`);
console.log(`Gender: ${gender}`);
}
//Return values
const af4 = (a, b) => {
let result = a + b;
return result;
}
//Single expresion
const af5 = (a, b) => a + b;
console.log("-----> af1()");
af1();
console.log("-----> af2()");
af2("Douglas");
console.log("-----> af3()");
af3("Pedro", 22, "Male");
console.log("-----> af4()");
console.log(af4(3 ,4));
console.log("-----> af5()");
console.log(af5(3 ,4));