t;hello&quot;)
    }, 1000)
    return deferred.promise
}

greetAsync()
    .then(function(value) {return value + &quot; world&quot;})
    .then(function(value) {console.log(value)}) //logs &quot;hello world&quot; after 1 second
</code></pre>
<h3 id="v1x18"><a href="#v1x18"><code>v1.x</code></a></h3>
<pre><code class="lang-javascript">var greetAsync = function() {
    return new Promise(function(resolve){
        setTimeout(function() {
            resolve(&quot;hello&quot;)
        }, 1000)
    })
}

greet