salam dhamantiin baahda somali programmers . Waa maxay farqiga ukala dhexeeya let iyo Variable

0
January 8, 2022
1

let is a new way for declaring variables while var is an old version of variable declaration in javascript.

3
0

variable waxa lagukaydiya wax yaabaha aad isticmalayso hadhow code kaaga. let laftirkeeda waxa loogu talagalay in wax lagu asign gareeyo wana labadalikara hadi loobahdo hashow. teeda kale let laftirkeed ayaaba ah variable logu talagalay in wax lagu kaydiyo.

 

0

wll farqiga udhaxeeyo waxaa waaye variable waa weel ki aad kushuban laheed datadaada halka let ay thy keyword, keyword kana waxaa waaye erayo luqada  ay laydahy(waa araybixinta luqada ay lay dahy(terminology)) kaasoo gooni uha tusaale markii aad rabto in kheexdo varaible javascript waa in aad kohormarisaa keword ka layiraahdo let ama var ama const  tusaale 

let name =’peyaza’;

console.log(‘magacaygu waa ‘ + name) 

result :magacaygu waa peyaza

 

February 15, 2022
0

let

     1. waxa  luuqada js lagu soo daray 2015 or ES6

      2.dib loo ma qeexi karo

      3. laakiin qiima ha waa ka bali kartaa 

 

var 

  1. waxa la cisticmaali jiray wixii ka horeeyay 2015 (old) or ES6 
  2. dib ayaa u qeexi karta taas oo aan fiicnayn
  3. dib ayaa qiimaha uga badali kartaa
     

     

    // var
    var score1 = 2;
    var score1 =3 ;
    console.log(score1)

    // let
    let score2 = 2;
    //let score2 =3 ;
    //wuxu kuu soo saraarayaa errorkan=> Identifier ‘score2’ has already been declared
    //
    console.log(score2)

    //lk sidani waa sax let markaa value ama qiimaha badalayso
    let score3 = 2;
    score3 =3 ;
    console.log(score3)

REC0MMENDATION ==> ka fagoow var ilaa aad ubaahato isticmaal marwal ba let  

February 16, 2022