Arrow Functions (ES6) သည် function expression များကို ပိုမိုတိုတောင်းသော syntax ဖြင့် ရေးသားနိုင်စေသည်။ ၎င်းတို့သည် this keyword ကို ကိုင်တွယ်ပုံတွင်လည်း ကွာခြားမှုရှိသည်။
javascript
// Traditional function expression
const add_old = function(a, b) {
return a + b;
};
// Arrow function
const add_new = (a, b) => a + b;
console.log(add_old(2, 3));
console.log(add_new(2, 3));You should see
5 5