JavaScript Statements အကိုးအကား
JavaScript ထုတ်ပြန်ချက်
HTML တွင်၊ JavaScript ထုတ်ပြန်ချက်များသည် ဝဘ်ဘရောက်ဆာမှ "လုပ်ဆောင်ရန်" "ညွှန်ကြားချက်များ" ဖြစ်သည်။
ဤထုတ်ပြန်ချက်သည် ဘရောင်ဇာအား "Hello Dolly" ဟုရေးရန် ပြောထားသည်။ id="demo" ပါရှိသော HTML အစိတ်အပိုင်းတစ်ခုအတွင်း
ဥပမာ
document.getElementById("demo").innerHTML = "Hello Dolly.";
Statements အကြောင်း သင်ခန်းစာအတွက်၊ ကျွန်ုပ်တို့၏ JavaScript Statements Tutorial ကို ဖတ်ရှုပါ ။
JavaScript ထုတ်ပြန်ချက် အမှတ်အသားများ
JavaScript ၏ထုတ်ပြန်ချက်များသည် မကြာခဏ လုပ်ဆောင်ရမည့် JavaScript လုပ်ဆောင်ချက်ကို ခွဲခြားသတ်မှတ်ရန်အတွက် ထုတ်ပြန်ချက်အမှတ်အသား ဖြင့် စတင်လေ့ရှိသည်။
Statement identifiers များသည် သီးသန့်စကားလုံးများဖြစ်ပြီး ပြောင်းလဲနိုင်သောအမည်များ (သို့မဟုတ် အခြားအရာများ) အဖြစ် အသုံးမပြုနိုင်ပါ။
အောက်ပါဇယားတွင် JavaScript ကြေငြာချက်သတ်မှတ်သူအားလုံးကို စာရင်းပြုစုထားသည်။
Statement | Description |
---|---|
break | Exits a switch or a loop |
class | Declares a class |
const | Declares a variable with a constant value |
continue | Breaks one iteration (in the loop) if a specified condition occurs, and continues with the next iteration in the loop |
debugger | Stops the execution of JavaScript, and calls (if available) the debugging function |
do ... while | Executes a block of statements and repeats the block while a condition is true |
for | Loops through a block of code a number of times |
for ... in | Loops through the properties of an object |
for ... of | Loops through the values of an iterable object |
function | Declares a function |
if ... else ... else if | Marks a block of statements to be executed depending on a condition |
let | Declares a variable |
return | Stops the execution of a function and returns a value from that function |
switch | Marks a block of statements to be executed depending on different cases |
throw | Throws (generates) an error |
try ... catch ... finally | Marks the block of statements to be executed when an error occurs in a try block, and implements error handling |
var | Declares a variable |
while | Marks a block of statements to be executed while a condition is true |