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
| function thisThrows() { | |
| throw new Error('Original error') | |
| } | |
| function thisAddsContextAndThrowsAgain() { | |
| try { | |
| thisThrows() | |
| } catch(err) { | |
| err.message = 'More info: ' + err.message | |
| err.statusCode = 404 |
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
| package main | |
| import ( | |
| "golang.org/x/tour/tree" | |
| "fmt" | |
| ) | |
| // Solving https://tour.golang.org/concurrency/8 | |
| // Walk walks the tree t sending all values |
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
| var imgs = new Array; | |
| // replace all images by the xxl version | |
| $('li > img').each(function(i, item){ | |
| var new_src = $(item).prop('src').replace('large', 'xxlarge'); | |
| $(item).prop('src', new_src); | |
| imgs.push($(item)); | |
| }); | |
| // kill everything on page | |
| $('body').empty(); |
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"> |