-
Notifications
You must be signed in to change notification settings - Fork 2
/
lesson01.html
94 lines (66 loc) · 2.53 KB
/
lesson01.html
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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
<!doctype html>
<html lang="en">
<head>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- Bootstrap CSS -->
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-giJF6kkoqNQ00vy+HMDP7azOuL0xtbfIcaT9wjKHr8RbDVddVHyTfAAsrekwKmP1" crossorigin="anonymous">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.1/css/all.min.css">
<link rel="stylesheet" href="css/style.css">
<title>DİZİLER</title>
</head>
<body>
<nav class="navbar navbar-dark bg-primary">
<div class="container">
<h3><a class="navbar-brand" href="index.html">DİZİLER</a></h3>
<h5 class="text-light">Oluşturma</h5>
</div>
</nav>
<div class="container main-container">
<div class="card">
<h2>1.Yöntem</h2>
<p><code>var dizi = [];</code></p>
<p>
<b>Şehirler:</b> <span id="cities1"></span>
</p>
</div>
<div class="card">
<h2>2.Yöntem</h2>
<p><code>var dizi = new Array();</code></p>
<p>
<b>Şehirler:</b> <span id="cities2"></span>
</p>
</div>
<div class="card">
<h2>3.Yöntem</h2>
<p><code>var dizi = split();</code></p>
<p>
<b>Şehirler:</b> <span id="cities3"></span>
</p>
</div>
<div class="card">
<h2>4.Yöntem</h2>
<p><code>var dizi = baska_dizi.slice(baslangic,bitis);</code></p>
<p><em>Mevcut bir diziden yeni bir dizi oluşturur. Bitiş dahil değil.</em> </p>
<p>
<b>Şehirler:</b> <span id="cities4"></span>
</p>
</div>
</div>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" integrity="sha384-ygbV9kiqUc6oa4msXn9868pTtWMgiQaeYH7/t7LECLbyPA2x65Kgf80OJFdroafW" crossorigin="anonymous"></script>
<script type="text/javascript">
var dizi = ['İstanbul','İzmir','Ankara','Bursa'];
document.getElementById('cities1').innerText = dizi;
var dizi2 = new Array('Erzurum', 'Kars', 'Ardahan');
document.getElementById('cities2').innerText = dizi2;
var sehirler = "Antalya;Adana;Mersin;Muğla";
var dizi3 = sehirler.split(';');
console.log(sehirler);
console.log(dizi3);
document.getElementById('cities3').innerText = dizi3;
var dizi4 = dizi3.slice(1,4);
document.getElementById('cities4').innerText = dizi4;
</script>
</body>
</html>