I have been struggling for quiet sometime now with conversion of file chunks to binary data and have come to this point
for(....){
$.when(chunkBinary(chunk[i][j])).done(function(result){ chunkInBinary = result;console.log(chunkInBinary);} )
}
Now I want to be able to use the value chunkInBinary outside the done function. Something like this:
for(....){
$.when(chunkBinary(chunk[i][j])).done(function(result){ chunkInBinary = result;} )
console.log(chunkInBinary);
}
Any suggestions on how I can achieve this?
My chunkBinary function returns a promise.