This file contains 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
// index.ts | |
export { Dog } from 'dog/dog.component.ts'; | |
export { Cat } from 'cat/cat.component.ts'; | |
// module.ts | |
import { Cat, Dog } from 'index.ts'; |
This file contains 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
let person = { name: "Frida" } | |
// original | |
person.city = person.city || "unknown" | |
// with logical or assignment operator | |
person.city ||= "unknown" |
This file contains 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
{ | |
"customizeUI.stylesheet": { | |
".editor-actions .codicon-compare-changes": "display: none !important;", | |
".editor-actions .codicon-open-preview": "display: none !important;", | |
".editor-actions .codicon-split-horizontal": "display: none !important;", | |
".editor-actions .codicon-toolbar-more": "display: none !important;" | |
}, | |
} |
This file contains 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
let dt = new Date(1906, 11, 9) | |
let lang = navigator.language // i.e. 'en-us' | |
// "Sunday, December 9, 1906" | |
dt.toLocaleDateString(lang, { | |
weekday: 'long', | |
year: 'numeric', | |
month: 'long', | |
day: 'numeric' | |
}) |
This file contains 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 lang="en"> | |
<head> | |
<meta charset="UTF-8" /> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | |
<title>Grid Tools</title> | |
<link href="https://fonts.googleapis.com/css2?family=Montserrat:wght@600&display=swap" rel="stylesheet"> |
This file contains 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 lang="en" class="no-js"> | |
<head> | |
<script> | |
document.documentElement.classList.remove("no-js"); | |
document.documentElement.classList.add("yes-js"); | |
</script> | |
<style> | |
.yes-js .yes-js-hidden { display: none; } | |
.no-js .no-js-hidden { display: none; } |
This file contains 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
let cat = {name: "Frida", age: 10 } | |
let dog = {name: "Ranger", age: 7 } | |
// before | |
console.log("cat", cat) | |
console.log("dog", dog) | |
// after | |
console.log({cat, dog}) | |
// { |
This file contains 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
let person = { | |
FirstName: "Ada", | |
LastName: "Lovelace", | |
Password: "********" | |
} | |
console.log(person) | |
// { FirstName: "Ada", LastName: "Lovelace", Password: "********"} | |
delete person.Password |
This file contains 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
$("body").on("click", ".rectangle", function(e) { | |
console.log("jquery", this) | |
// do stuff | |
}); |
This file contains 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
let msg = "🎃 BOO" | |
console.log(msg[0]) // "�" | |
console.log(msg.charAt(0)) // "�" | |
console.log([...msg][0]) // "🎃" |