Skip to main content

Enzaniso

Enzaniso chii?#

Not yet Revised

Enzaniso dzinoshandiswa kana uchida kuenzanisa ma variables 2. Ngatomboti une 2 mavariables awagadzira kare variableYekutanga na variableYechipiri. Kana uchishandisa enzaniso, unenge uchitora variable yekutanga, oienzanisa ne imwe variable. Pane enzaniso dzemhando 3.

Apa, unogona kutora variableYekutanga uchida kuona zvinhu 3 izvi:

Mhando yeenzaniso
  1. Yakafanana na variableYechipiri here?
  2. Idiki pane variableYechipiri here?
  3. Ihombe kudarika/kupfuura variableYechipiri here?

Mashandisirwo e enzaniso#

Mashandisirwo chaiwo e enzaniso uchazomaoona kana waverenga topic ye Kana, Zvimwe. Asi panguva ino unogona kumboona zvinoitika panenge pachishandiswa enzaniso.

Chii chikuitika apa?🤯

Tsananguro

Line 1 na Line 2

variableYekutanga = 5variableYechipiri = 6

Tatanga nekugadzira ma variable 2:variableYekutanga na variableYechipiri. Ndiwo ma variable atiri kuda kuzoenzanisa

Line 4 na Line 5

zvakafananaHere = variableYekutanga yakafanana na variableYechipirinyora(zvakafananaHere)

Apa tiri kuda kuona kuti variableYekutanga yakafanana na variableYechipiri here, saka tashandisa yakafanana na. Ukaenzanisa ma variable aya, unofana kuona kuti akaenzana here kana kuti kwete.

ko nyora() arikutsvagei pa line 5

pa line 4 tanga tichienzanisa variableYekutanga na variableYechipiri, pakuenzanisa kwatiri kuita, tinogona kuona kuti ichokwadi kana kuti kunyepa. Kuti iwewe ugone kuzoona kuti chii chaitiki pataenzanisa, uchashandisa nyora().

Tagadzira variable inonzi zvakafananaHere tichibva taita kuti variable iyoyo iite zvinhu zvichabuda pakuenzanisa ma variableYekutanga na variableYechipiri. Tinoita izvi nekuti tikuda kuzonyora variable iyoyo tione kuti chii chaitika pataenzanisa.

Chiita izvi wega unone zvinoitika

Zvekuita

Mu Application ye ShonaScript

  1. nyora kuti:
nyora:    ```    variableYekutanga = 5    variableYechipiri = 6    zvakafananaHere = variableYekutanga akafanana na variableYechipiri    nyora(zvakafananaHere)    ```
  1. baya bhatani re round riri pazasi pe screen

Kana kuti

Mu VS Code

  1. mu file rakanzi index.shona nyora:
    variableYekutanga = 5variableYechipiri = 6zvakafananaHere = variableYekutanga akafanana na variableYechipirinyora(zvakafananaHere)
  2. mu terminal nyora kuti node shona.js, wobaya enter
  3. mu terminal zvekare, nyora kuti node index.js, wobaya enter

Ukaita masteps aya zvakanaka, unofana kuona mu terminal makanzi

false

Zvichireva kuti kunyepa. Ukatarisawo variableYekutanga ndi 5, na variableYechipiri ndi 6 havana kuenzana saka zvechokwadi kuti 5 akafanana na 6 kunyepa.

Tsananguro

Line 7 na Line 8

Matsanangurirwo aitwa pa line 4 na line 5 akafanana ne matsanangurirwo epa line 7 na line 8. Asi changochinja ndechekuti tiri kuda kuona kuti variableYekutanga idiki here pana variableYechipiri. Ukadzokorora masteps 3 arimu box re green rakanzi Ita, unofana kuona mu terminal makanzi:

true

true zvireva kuti ichokwadi. Zvechokwadiwo variableYekutanga(5), idiki pane variableYechipiri(6)

Line 10 na Line 11

Matsanangurirwo aitwa pa line 4 na line 5 akafanana ne matsanangurirwo epa line 7 na line 8. Asi changochinja ndechekuti tiri kuda kuona kuti variableYekutanga ihombe here pana variableYechipiri. Ukadzokorora masteps 3 arimu box re green rakanzi Ita, unofana kuona mu terminal makanazi:

false

False zvireva kuti kunyepa. Zvechokwadi variableYekutanga(5), haasi muhombe pane variableYechipiri (6)

Enzaniso dzinoshandiswa pakawanda wanda sezvauchazoona ukaramba uchiverenga