Skip to content
GitHub

Interactive Section - Functions

welcomeUser ဆိုတဲ့ Function တစ်ခု ရေးပါ။ သူက parameter အနေနဲ့ name ကို လက်ခံပြီး “Welcome back, [name]!” ဆိုပြီး Console မှာ ထုတ်ပေးရမယ်။

function welcomeUser(name) {
// Your code...
}
welcomeUser("Thida");

Exercise 2: Converter Function (Celsius to Fahrenheit) 🌡️

Section titled “Exercise 2: Converter Function (Celsius to Fahrenheit) 🌡️”

အပူချိန် Celsius ကို ပေးလိုက်ရင် Fahrenheit ပြောင်းပေးတဲ့ Function ရေးပါ။ ဖော်မြူလာ: (C * 9/5) + 32

return ပြန်ပေးဖို့ မမေ့နဲ့နော်။

function toFahrenheit(celsius) {
// Your code...
}
let temp = toFahrenheit(30);
console.log(temp); // Should be 86

အောက်ပါ code ကို Arrow Function ပုံစံ ပြောင်းရေးပါ။

function multiply(x, y) {
return x * y;
}

👇 Write here:

const multiply = (x, y) => {
// ???
};