title: Asynchronous and Synchronous in javaScript
body: <p>I have to use the <a href="https://msdn.microsoft.com/en-us/library/office/dn735924.aspx" rel="nofollow noreferrer">SP.RequestExecutor.js</a> library. The problem is I need to run the async function in sync behavior. After deep search I found <code>await</code> and <code>async</code> methods but they are not compatible with Internet Explorer(IE>9). How I can make convert the async functions to sync and be compatible on IE>9 and Chrome?</p>
  
  <pre><code>function executorRun() {
    console.log('end2');
    var executor = new SP.RequestExecutor('path'); 
    var result=[];
    executor.executeAsync({    
        url: 'URL',
        method: "POST",
        headers: {
            "accept": "application/json;odata=verbose",
            "content-type": "application/json;odata=verbose",      
        },
        data: JSON.stringify(requestData),
        success: function (data) {
          console.log('end3')
          console.log(data);//Debug statement 
          //Handle data and store in result       
        },       
        error: function (error) {
          console.log(error);
        }
     });
    return result;
  }
  
  async function test () { 
    console.log('end1');
    const data = await executorRun();
    console.log('end4');
  }
  
  test();
  </code></pre>
  
  <p>I need the output ass follows:</p>
  
  <blockquote>
    <p>end1
    end2
    end3
    end4.</p>
  </blockquote>
  
  <p>The above code is running in chrome but on IE refuse the <code>await</code> and <code>async</code>.</p>