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
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.
Read about
var
,let
andconst
in JavaScript.– axiac
1 min ago