HTML
<template>
<lightning-card>
<p>Result of adding 2 and 3: {result}</p>
</lightning-card>
</template>
Java Script
import { LightningElement } from 'lwc';
export default class ArrowFunction extends LightningElement {
result;
addNumbers = (a, b) => {
return a + b;
}
handleAdd() {
this.result = this.addNumbers(2, 3);
}
connectedCallback(){
this.handleAdd();
}
}
Video
Video does not exists.