正如代码中所评论的那样,在检查else if
之后我需要等待writeFile(lFileData);
。如何做到这一点?
for(var i=0;i<mLocalStorageCount;i++)
{
if(i <= 1)
{
writeFile(lFileData); //This action takes a lot of time with its call backs. I need a wait here.
}
else if(i > 1 && i <=3)
{
someOtherfun()
}