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; }

15th Mar 2022, 11:36 AM
MD. Jashim Uddin
MD. Jashim Uddin - avatar
6 Respuestas
+ 1
With remove the … characters.
15th Mar 2022, 11:52 AM
JaScript
JaScript - avatar
+ 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.
15th Mar 2022, 12:00 PM
JaScript
JaScript - avatar
+ 1
Database connection is Asynchronus Programming. func1 should be returning a Promise, so you probably need keywords such as async await .then() etc
16th Mar 2022, 12:20 PM
Gordon
Gordon - avatar
0
JaScript it is not part of code. Here, other code will be written.
15th Mar 2022, 11:53 AM
MD. Jashim Uddin
MD. Jashim Uddin - avatar
0
JaScript this code is related to database related operation.
15th Mar 2022, 12:04 PM
MD. Jashim Uddin
MD. Jashim Uddin - avatar
0
Gordon Thanks
16th Mar 2022, 1:39 PM
MD. Jashim Uddin
MD. Jashim Uddin - avatar