How to replace 'Async=false' with promise in javascript?
<p>I have read a lot about <code>promises</code> but I'm still not sure how to implement it.</p>

<p>I wrote the folowing AJAX call with <code>async=false</code> in order for it to work, but I want to replace it with promise as I saw that <code>async=false</code> is deprecated.</p>

<pre><code>self.getBalance = function (order) {
    var balance;
    $.ajax({
        url: "/API/balance/" + order,
        type: "GET",
        async: false,
        success: function (data) {
            balance = data;
        },
        done: function (date) {
        }
    });
    return balance;
}
</code></pre>

<p>Would you be able to help me? I just need an example to understand it.</p>