Welcome to SomaliNet Forums, a friendly and gigantic Somali centric active community. Login to hide this block

You are currently viewing this page as a guest. By joining our community you will have the ability to post topics, ask questions, educate others, use the advanced search, subscribe to threads and access many, many other features. Registration is quick, simple and absolutely free. Join SomaliNet forums today! Please note that registered members with over 50 posts see no ads whatsoever! Are you new to SomaliNet? These forums with millions of posts are just one section of a much larger site. Just visit the front page and use the top links to explore deep into SomaliNet oasis, Somali singles, Somali business directory, Somali job bank and much more. Click here to login. If you need to reset your password, click here. If you have any problems with the registration process or your account login, please contact us.

Module 1: KEYWORD let IN AND OUT..................

Qaybta Xirfada Sayniska iyo iwm

Moderators: Moderators, Junior Moderators

OUR SPONSOR: LOGIN TO HIDE
User avatar
afisoone
SomaliNet Super
SomaliNet Super
Posts: 5489
Joined: Wed Jul 22, 2009 9:46 pm
Location: We all want to become president even though Amisom controls Mogadishu

Module 1: KEYWORD let IN AND OUT..................

Postby afisoone » Thu Oct 06, 2016 1:04 pm

variables waxaa lagu dhisaa program kasto aad ku qoreeysid javascript. Maanta waxaan rabaa inaa sharaxo asagoo dhan iyo scope kiisa oo dhan.

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]
Variablekaan qor iyo outside waxaa laseemeeyay [before if statement or curly braces]. That means waa access kareen kartaa inside and outside[if statements or curly braces kasto ama function ha ahaado ama san yuu ahaanee.

here is the evidence.

Code: Select all

[quote]if(qor==="Saciid Afisoone") { console.log(outside); } [/quote]
You see we access the variable outside inside if statements. That proves any variable declared before if statement or anything with curly braces can be access inside if statements or curly braces.

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]
Now when we run it we access the variable inside because we call it inside the if statement or the curly braces. but if we call outside of the if statements or curly braces, we will get error.

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]
you see here is the rule: Variables that is defined outside if statements or curly braces can be access inside if statements or curly braces, but if variables is defined inside if statements or curly braces can only access inside that if statements or curly braces.
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]
That module one..

Written by
Macalin Afisoone

User avatar
afisoone
SomaliNet Super
SomaliNet Super
Posts: 5489
Joined: Wed Jul 22, 2009 9:46 pm
Location: We all want to become president even though Amisom controls Mogadishu

Re: Module 1: KEYWORD let IN AND OUT..................

Postby afisoone » Fri Oct 07, 2016 4:33 am

Remember [qoute] lamasocdo codeka. Next module I will correct for now here

is the correct full let keyword module1.

Code: Select all

<!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>


OUR SPONSOR: LOGIN TO HIDE

Hello, Has your question been answered on this page? We hope yes. If not, you can start a new thread and post your question(s). It is free to join. You can also search our over a million pages (just scroll up and use our site-wide search box) or browse the forums.

  • Similar Topics
    Replies
    Views
    Last post

Return to “Careers - Engineering, Science & Computers”

Who is online

Users browsing this forum: No registered users and 4 guests