Here is Differences between var, let and const in LWC
Examples:
if(true){
var temp = 'Test LWC;
}
temp;
This will give output : Test LWC
if(true){
let temp = 'Test LWC;
}
temp;
This will give output : Uncaught ReferenceError: temp is not defined at <anonymous>:4:1
if(true){
const temp = 'Test LWC;
}
temp;
This will give output : Uncaught ReferenceError: temp is not defined at <anonymous>:4:1
if(true){
const temp = 'Test LWC;
temp = 'Test LWC Again';
}
temp;
This will give output : Uncaught TypeError: Assignment to constant variable
Subscribe blog for More updates !!!
Read More: WhatsApp on Salesforce Integration in 5 Steps
Which Salesforce API Do I Use in Integration?
When To Use Salesforce REST API
When To Use Salesforce SOAP API
When To Use Salesforce Bulk API
Latest Salesforce Interview Questions and Answers: