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
| const loc: [number, number] = [10, 20]; | |
| panTo(loc); |
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
| const loc: any = [10, 20]; | |
| panTo(loc); | |
| const loc = [10, 20]; | |
| panTo(loc as any); |
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
| const loc = [10, 20]; | |
| loc.push(30); |
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
| // Parameter is a (latitude, longitude) pair. | |
| function panTo(where: [number, number]) { /* ... */ } | |
| // Inline: | |
| panTo([10, 20]); // inline: ok | |
| // Reference: | |
| const loc = [10, 20]; | |
| panTo(loc); // reference. Will this work? |
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
| export function purchase(what: string) { /* ... */ } | |
| purchase('Macbook Air'); // Inline | |
| const product = 'Macbook Air'; | |
| purchase(product); // reference |
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
| const product = 'Macbook Air'; | |
| purchase(product); // reference form |
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 purchase(product) { /* ... */ } | |
| purchase('Macbook Air'); |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
| #!/usr/bin/env python | |
| """Pretty-print GeoJSON in a slightly more compact way by putting coordinates on one line. | |
| Compare: | |
| [ | |
| [ | |
| 37.23423, | |
| 79.23423 | |
| ], |
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 results = document.querySelectorAll('.issue-list h3 a'); | |
| var html = ''; | |
| for (const a of document.querySelectorAll('.issue-list h3 a')) { | |
| html += `<a style="text-decoration: underline; color: #15c;" href="https://github.com/${a.getAttribute('href')}">${a.textContent}</a><br>\n` | |
| } | |
| var container = document.createElement('p'); | |
| container.setAttribute('style', 'font: 13px/1.5 sans-serif; margin-left: 100px; margin-bottom: 50px;'); | |
| container.innerHTML = html; | |
| document.body.appendChild(container); | |
| container.scrollIntoViewIfNeeded(); |