How to return the value inside a function? [duplicate]

1

The best way to do a%
$('random-button').click(function(){
    console.log(moveFile());
});

function moveFile(fileID, newFolderID, currentFolder){
     gapi.client.drive.files.update({
        'fileId': fileID,
        'addParents': newFolderID,
        'removeParents' : currentFolder

    }).execute(function(resposta){
        return resposta;
    });
}

I need to send back the value returned, I tried to save the whole function in a variable but the return comes as return , how can I do it?

    
asked by anonymous 19.05.2018 / 20:28

0 answers