forked from danilopgon/javascript-fs-pt-41
-
Notifications
You must be signed in to change notification settings - Fork 0
/
scripts.js
62 lines (35 loc) · 1.01 KB
/
scripts.js
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
// FUNCIONES
// Notación tradicional
const name = 'Hola'
function greet (name) {
console.log(`Hello, ${name}!`);
}
// console.log(name);
// greet('Otro ejemplo');
// greet();
// return
// function sum (firstNumber, secondNumber) {
// const result = firstNumber + secondNumber;
// return result;
// }
// sum(1, 1) // 2
2
// const firstSumResult = sum(1, 2);
// const secondSumResult = sum(12,323);
// const thirdSumResult = sum(79, 1561);
// const fourthSumResult = sum(firstSumResult, secondSumResult);
// console.log(firstSumResult + secondSumResult + thirdSumResult)
function textToLowerCase (text) {
return text.toLowerCase();
}
const myText = 'LOREM IPSUM';
const anotherText = 'ipsum LOREM';
const result = textToLowerCase(myText)
console.log(result);
// EC6 -> Arrow function
function exampleFuncion (text) {
return text.toLowerCase();
}
const arrow = text => text.toLowerCase();
// const myFirstArrowFunction = text => text.toLowerCase();
console.log(myFirstArrowFunction('HOLA!'));