Created
          June 3, 2016 13:09 
        
      - 
      
- 
        Save anonymous/39d6209649c8354e970f1b9405f5d3b7 to your computer and use it in GitHub Desktop. 
    JS Bin // source http://jsbin.com/hogamorude
  
        
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | <!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> | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | '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