I got this code from someone’s project from github… When I was trying to read the code, I found out that he/she uses same variable name inside of two different functions, is that going to cause a problem/bug? are both variables(err) somehow going to intervene with each other due to using the same name?
const getUser = async () => {
try{
const user = await getUserDataFromDB();
}catch(error){
// Same variable name here!
const err = [array of errors];
throw err;
}
};
const getPost = () => {
try{
const post = await getPostDataFromDB();
}catch(error){
// Same variable name here!
const err = [array of errors];
throw err;
}
};