FAUSTINE MWOYA November 9, 2025 1 min read

Jinsi ya Kutumia Conditional Statements: if, else, switch

if na else zinakagua conditions.
switch inatumika kwa multiple cases.
Example Code:
<script>
let grade = "A";

if (grade === "A") {
console.log("Excellent");
} else if (grade === "B") {
console.log("Good");
} else {
console.log("Keep Trying");
}

// switch
switch(grade) {
case "A": console.log("Excellent"); break;
case "B": console.log("Good"); break;
default: console.log("Keep Trying");
}
</script>

Tembelea https://www.faulink.com kupata mifumo yote muhimu

YouTube Description:
Jifunze conditional statements za JavaScript: if, else, na switch.
Hashtags:
#JSIfElse #SwitchCase #Faulink

🚀 Unahitaji mfumo au website ya biashara?

Chagua huduma hapa chini kisha mteja bofya moja kwa moja kwenda kwenye ukurasa wa huduma au kuwasiliana nasi kwa WhatsApp.

Share this post

Comments

0
No comments yet. Be the first to comment.

Continue Reading

Subscribe

Get new updates

Jiunge upokee posts mpya, tutorials, na updates za mifumo moja kwa moja kwenye email yako.

Faulink Support