Functions များသည် code block တစ်ခုဖြစ်ပြီး သူ့ကိုခေါ်လိုက်မှသာ run ပါတယ်။ Parameters များလက်ခံနိုင်ပြီး တန်ဖိုးတစ်ခုကို return ပြန်ပေးနိုင်သည်။
javascript
// Function definition
function add(a, b) {
return a + b;
}
// Calling the function
let sum = add(5, 7);
console.log("The sum is: " + sum);You should see
The sum is: 12