-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdatatype-strings.html
More file actions
77 lines (60 loc) · 1.84 KB
/
Copy pathdatatype-strings.html
File metadata and controls
77 lines (60 loc) · 1.84 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
67
68
69
70
71
72
73
74
75
76
77
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<h1>Data type STRING</h1>
<ul>
<li>Primavera</li>
<li>Verano</li>
<li>Otoño</li>
<li>Invierno</li>
</ul>
<script>
/*
Objeto: Es una coleccion de informacion
Propiedades: son caracteristicas o atributos que describen o definen algo del objeto
Metodos: Son las acciones que el objeto hace, se puden diferenciar
de las propiedades porque siempre terminan en parentesis, dentro de estos
parentesis ellos pueden resivir datos para poder trabajar
*/
// CADENA DE TEXTO AKA STRING
let nombre = "Christian"
let apellido = "Londono"
let saludo = new String("Hola Munso")
let texto = "Christian esta aprendiendo JS con un curso en linea todos los dias en las noches"
console.log(nombre,apellido,saludo)
console.log(
nombre.length,
apellido.length,
saludo.length,
nombre.toUpperCase(),
apellido.toLowerCase(),
texto.includes("JS"),
texto.includes("Java"),
texto.trim(),
texto.split(" ")
)
// CONCATENAR
let name = "Christian"
let lastname = "Londono"
let rewarads = "Hola mi nombre es " + name + " " + lastname + " ";
console.log(rewarads)
//INTERPOLACION DE VARIABLES
let saludo2 = `Hola mi nombre es ${name} ${lastname}.`;
console.log(saludo2)
//TEMPLATE STRING ``
let ul = "<ul><li>Primavera</li><li>Verano</li><li>Otoño</li><li>Invierno</li></ul>"
console.log(ul)
let ul2 = ` <ul>
<li>Primavera</li>
<li>Verano</li>
<li>Otoño</li>
<li>Invierno</li>
</ul>`;
console.log(ul2)
</script>
</body>
</html>