Skip to content

Instantly share code, notes, and snippets.

Created June 3, 2016 13:09
Show Gist options
  • Save anonymous/39d6209649c8354e970f1b9405f5d3b7 to your computer and use it in GitHub Desktop.
Save anonymous/39d6209649c8354e970f1b9405f5d3b7 to your computer and use it in GitHub Desktop.
JS Bin // source http://jsbin.com/hogamorude
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<script id="jsbin-javascript">
'use strict';
var promiseOne = Promise.reject();
var promiseTwo = promiseOne.then(function () {
console.log('then');
});
newPromise = promiseTwo['catch'](function () {
console.log('catch');
});
promiseTwo.then(function () {
console.log('itt legyel!');
})['catch'](function () {
console.log('ide nem, ugye?');
});
</script>
<script id="jsbin-source-javascript" type="text/javascript">const promiseOne = Promise.reject();
const promiseTwo = promiseOne.then(() => {
console.log('then');
});
newPromise = promiseTwo.catch( () => {
console.log('catch');
})
promiseTwo.then( () => {
console.log('itt legyel!');
}).catch( () => {
console.log('ide nem, ugye?');
})</script></body>
</html>
'use strict';
var promiseOne = Promise.reject();
var promiseTwo = promiseOne.then(function () {
console.log('then');
});
newPromise = promiseTwo['catch'](function () {
console.log('catch');
});
promiseTwo.then(function () {
console.log('itt legyel!');
})['catch'](function () {
console.log('ide nem, ugye?');
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment