let's do the first one................
Code: Select all
[quote]let qor="Saciid Afisoone";
let outside="meelkasto waa loogu wici karaa";
console.log(qor);[/quote]
here is the evidence.
Code: Select all
[quote]if(qor==="Saciid Afisoone")
{
console.log(outside);
}
[/quote]
Now what about if we a new variable inside the if statements or inside curly braces. Then you can only access inside if statements or curly braces only and only and here is the evidence.
Code: Select all
[quote]if(qor==="Saciid Afisoone")
{
console.log(outside);
let inside="you can access only here";
console.log(inside);
}[/quote]
here is the evidence...
Code: Select all
[quote]if(qor==="Saciid Afisoone")
{
console.log(outside);
let inside="you can access only here";
console.log(inside);
}
console.log(inside);[/quote]
That is what is block of scope is.
Ok. That is all about javascript 6 also you can var or const.
So here is full document about variable let.... and keep it copy and paste and save it... now you are ready the next module.
here is the full page..
Code: Select all
[quote]<!doctype html>
<html>
<meta charset="utf-8">
<head>
<title>Isticmaalka variableka let</title>
</head>
<body>
<script type="text/javascript">
let qor="Saciid Afisoone";
let outside="meelkasto waa loogu wici karaa";
console.log(qor);
if(qor==="Saciid Afisoone")
{
console.log(outside);
let inside="you can access only here";
console.log(inside);
}
console.log(inside);
</script>
</body>
</html>[/quote]
Written by
Macalin Afisoone