When to use const or var or let and lambda expresion internals


When to use const or var or let and lambda expresion internals


groups= ;

getGroup(id){
const s = groups.find(t => t.id === id);
return s;
}

getGroup(id){
var s = groups.find(t => t.id === id);
return s;
}


getGroup(id){
let s = groups.find(t => t.id === id);
return s;
}


s


var


let


group


forEach





Read about var, let and const in JavaScript.
– axiac
1 min ago


var


let


const





You should refer MDN declarations
– Narendra Jadhav
34 secs ago









By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Comments

Popular posts from this blog

paramiko-expect timeout is happening after executing the command

Opening a url is failing in Swift

Export result set on Dbeaver to CSV