Answer the question
In order to leave comments, you need to log in
What does flat code mean?
Everywhere they write flat asynchronous code or written in a flat way. What does flat code mean?
Answer the question
In order to leave comments, you need to log in
Code that is written and read as if it were not asynchronous at all (all calls are one after the other).
js example
const parseAdminsData = async ()=>{
const token = await getToken();
const users = await getUsers(token);
const admins = users.filter(({isAdmin})=>isAdmin);
return admins;
}
nested code (nested):
for a in range(10):
for b in range(20):
for c in range(30):
for d in range(40):
if d == 1:
if c == 1:
if b == 1:
if a == 1:
print('nested code')
for a in range(10):
print('flat code')
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question