what is .then for?

Posted 7 months ago by davy_yg

Hello,

I cannot understand what is .then is for?

Why even use .then? why not just goes with function(data){ }) without .then?

myForm.addEventListener('submit', function(e){

    e.preventDefault();
    var url = 'https://randomuser.me/api/?results=10';
    axios.get(url)
    .then(function(data){
    
        console.log('enter then');
    })

})

Please sign in or create an account to participate in this conversation.

Reply to

Use Markdown with GitHub-flavored code blocks.