<!DOCTYPE html>
<html>
<head>
<script src="https://cdnjs.cloudflare.com/ajax/libs/babel-core/5.8.29/browser.js"></script>
<script type="text/babel">
const delay = seconds => {
return new Promise(resolve => {
setTimeout(resolve, seconds * 1000)
});
};
console.log("zero seconds");
delay(1).then(() => console.log("one second"));
delay(3).then(() => console.log("three second"));
</script>
<title>Promises</title>
</head>
<body>
</body>
</html>

Output: