-
Notifications
You must be signed in to change notification settings - Fork 0
/
Blog.html
139 lines (128 loc) · 9.82 KB
/
Blog.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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Daily News</title>
<link rel="stylesheet" href="style/style.css">
<!-- Boostrap CDN -->
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.0/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-gH2yIJqKdNHPEq0n4Mqa/HGKIhSkIHeL5AyhkYV8i59U5AR6csBvApHHNl/vI1Bx" crossorigin="anonymous">
<!-- fontAwesome -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.2.0/css/all.min.css" integrity="sha512-xh6O/CkQoPOWDdYTDqeRdPCVd1SpvCA9XXcUnZS2FmJNp1coAFzvtCN9BmamE+4aHK8yyUHUSCcJHgXloTyT2A==" crossorigin="anonymous" referrerpolicy="no-referrer" />
</head>
<body>
<header>
<!-- navbar -->
<nav class="navbar navbar-expand-lg ">
<div class="container-fluid container">
<a class="navbar-brand" href="#">Daily <span class="pepole">News</span></a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNavAltMarkup" aria-controls="navbarNavAltMarkup" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarNavAltMarkup">
<div class="navbar-nav ms-auto">
<a class="nav-link active" aria-current="page" href="index.html">News</a>
<a class="nav-link active text-decoration-underline text-primary" aria-current="page" href="#">Blog</a>
<a class="navbar-brand" href="#">
<img class="rounded-5" src="user_img/circle-profile-pic.jpg" alt="" width="40" height="40">
</a>
</div>
</div>
</div>
</nav>
</header>
<hr class="fw-bold">
<main>
<div class="px-5 mx-auto ">
<div class="accordion" id="accordionExample">
<div class="accordion-item">
<h2 class="accordion-header" id="headingOne">
<button class="accordion-button" type="button" data-bs-toggle="collapse" data-bs-target="#collapseOne" aria-expanded="true" aria-controls="collapseOne">
what are the difference between var,let and constant?
</button>
</h2>
<div id="collapseOne" class="accordion-collapse collapse show" aria-labelledby="headingOne" data-bs-parent="#accordionExample">
<div class="accordion-body">
<strong>var :</strong>
<small>Before ES6, the var keyword was used to declare a variable in JavaScript. The var keyword has been around since the inception of JavaScript, and it’s what you will see in any pre ES6 code.
<br>
Variables declared using the var keyword are either globally or functionally scoped, they do not support block-level scope. This means that if a variable is defined in a loop or in an if statement it can be accessed outside the block and accidentally redefined leading to a buggy program. As a general rule, you should avoid using the var keyword.</small>
<br>
<strong>Let :</strong>
<small>In many ways, the let keyword is very similar to the var keyword as they both allow you to reassign the value later on. The main difference between the two is that let deals with a block scope and although it can be reassigned it cannot be redeclared.</small>
<br>
<strong>Const :</strong>
<small>Like the let keyword, the const keyword is also blocked scoped. However, declaring a variable with the const keyword means that it cannot only be redeclared but also it cannot be reassigned. Therefore, every const variable must be assigned a value at the time of declaration.</small>
<br>
</div>
</div>
</div>
<!-- <div class="accordion-item">
<h2 class="accordion-header" id="headingTwo">
<button class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#collapseTwo" aria-expanded="false" aria-controls="collapseTwo">
what are the difference arrow function and regular function?
</button>
</h2>
<div id="collapseTwo" class="accordion-collapse collapse" aria-labelledby="headingTwo" data-bs-parent="#accordionExample">
<div class="accordion-body">
<strong>Arrow Function :</strong>
<small>Arrow function or an arrow function expression is a more concise syntax of writing regular function expressions that allows us to write shorter and neater functions. Arrow functions were introduced in ECMAScript 6 (2017). They are also known as a fat arrow function as they utilize the => token, which is shaped like a fat arrow.</small>
<br>
<strong>Regular Function :</strong>
<small>Like the let keyword, the const keyword is also blocked scoped. However, declaring a variable with the const keyword means that it cannot only be redeclared but also it cannot be reassigned. Therefore, every const variable must be assigned a value at the time of declaration.</small>
<br>
</div>
</div>
</div> -->
<div class="accordion-item ">
<h2 class="accordion-header" id="headingThree">
<button class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#collapseThree" aria-expanded="false" aria-controls="collapseThree">
what are the difference between map,forEach ,filter,find?
</button>
</h2>
<div id="collapseThree" class="accordion-collapse collapse" aria-labelledby="headingThree" data-bs-parent="#accordionExample">
<div class="accordion-body">
<strong>ForEach :</strong>
<small>Foreach takes a callback function and run that callback function on each element of array one by one.Basically forEach works as a traditional for loop looping over the array and providing you array elements to do operations on them.</small>
<br>
<strong>Filter :</strong>
<small>The main difference between forEach and filter is that forEach just loop over the array and executes the callback but filter executes the callback and check its return value. If the value is true element remains in the resulting array but if the return value is false the element will be removed for the resulting array.</small>
<br>
<strong>Map :</strong>
<small>Map like filter & foreach takes a callback and run it against every element on the array but whats makes it unique is it generate a new array based on your existing array.
<br>
Map ran through every element of the array, multiplied it to 10 and returned the element which will be going to store inside our resulting array.
<br>
Like filter, map also returns an array. The provided callback to map modifies the array elements and save them into the new array upon completion that array get returned as the mapped array.
</small>
<br>
<strong>Find :</strong>
<small>Function .find() is also a search function like the previous but they differ in one small detail — this function returns only one match in an array. If in an array is more than one result, the function will return the first that has matched.</small>
<br>
</div>
</div>
</div>
<div class="accordion-item ">
<h2 class="accordion-header" id="headingFour">
<button class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#collapseFour" aria-expanded="false" aria-controls="collapseFour">
why do we use template string?
</button>
</h2>
<div id="collapseFour" class="accordion-collapse collapse" aria-labelledby="headingFour" data-bs-parent="#accordionExample">
<div class="accordion-body">
<strong>Template String :</strong>
Template literals are sometimes informally called template strings, because they are used most commonly for string interpolation (to create strings by doing substitution of placeholders). However, a tagged template literal may not result in a string; it can be used with a custom tag function to perform whatever operations you want on the different parts of the template literal.
</div>
</div>
</div>
</div>
</div>
</main>
<footer class="text-center py-3">
<small class="">© 2022 All right reserved! Made by" webtrue</small>
</footer>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.0/dist/js/bootstrap.bundle.min.js" integrity="sha384-A3rJD856KowSb7dwlZdYEkO39Gagi7vIsF0jrRAoQmDKKtQBHUuLZ9AsSv4jD4Xa" crossorigin="anonymous"></script>
<script src="js/app.js"></script>
</body>
</html>