0
How can this Javascript code be improved?
const func1 = () => { ... return databaseConnection; } const func2 = () => { const database = func1(); ... return valueFromDatabase; } const func3 = () => { const valueFromDatabase = func2(); const database = func1(); ... return calculationBasedOnDatabaseData; }
6 Respuestas
+ 1
With remove the … characters.
+ 1
That's what it's all about MD. Jashim Uddin . The question cannot be answered if the code is not complete. I don't see what the point is.
+ 1
Database connection is Asynchronus Programming.
func1 should be returning a Promise, so you probably need keywords such as
async
await
.then()
etc
0
JaScript it is not part of code. Here, other code will be written.
0
JaScript this code is related to database related operation.
0
Gordon Thanks