Forexample, ifstatementorloopwouldbe a blockthatthatvariablesonlyavailableinsideofbutnotoutsideofthatiforLuke, forexample.
Solet's jumpintoanexampleofmeshowingyouthatnow.
So I justhave a simpleexampleopenonlefthere, where I havetwodifferentblockstofindwiththese, ifstatementsandinsideoftheseblocks, I'm declaring a variable, andthe 1st 1 I'm declaringusingbarandthesecondvariable I'm declaringusing.
Let I meantjustloggingtheoutputofthesevariablestothecouncilontherightsideofthescreenhere.
Butif I didthiswithlet, forexampleSoif I didlet's wet, veryboldequalstrue.
Andthenrightafterthat, I triedtosetittofalsehere.
If I saythatyouseethat I seethatwetvariablehasalreadybeendeclared.
I can't actuallyredeclareit, but, levar, I canreadit.
Clearthebarasmanytimesas I want.
Thisisactuallyoneofthethingsthat I thinkisthebiggestproblemswiththebarkeywordfordeclaringvariablesbecauseitallowsyoutooverridevariablesaccidentallythatyoudidn't actuallymeantooverwritebecausenormallywhenyoudeclarevariablewith a keywordinfrontofthedateofourletherconstant, you'rethinkingthisisthefirsttimethisvariableisbeingdeclared.
Anotherwaythatforeignbutdifferisthatbaractuallyallowsustouse a variablebeforewedeclareitSo, forexample, ifwehave a variablewouldcallitfarvariableagainifwejustwannacouncildotwantbarvariableandthisisbeforewe'd actuallydeclaredbarvariable.