-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfuncionesCondiciones.php
More file actions
executable file
·53 lines (41 loc) · 1.5 KB
/
funcionesCondiciones.php
File metadata and controls
executable file
·53 lines (41 loc) · 1.5 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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Combinando Funciones con Condiciones</title>
</head>
<body>
<script>
function mensaje_final(nota){
switch (nota){
case 'A':
console.log('muy bien!!');
return 'muy bien!';
break;
case 'B':
console.log('bien');
break;
case 'C':
console.log('mmm mas o menos :S');
break;
default:
console.log('no se que decir');
break;
}
}
var resultado = mensaje_final('A');
console.log(resultado);
mensaje_final('C');
mensaje_final('B');
function decorador(nombre, genero){
if (genero == 'M'){
return 'Sr. ' + nombre;
}
else if (genero == 'F'){
return 'ingresar M o F';
}
}
console.log(decorador('Pablo', 'F'));
</script>
</body>
</html>