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
console.log(~"apple".indexOf("a")) // true | |
console.log("apple".indexOf("a") >= 0) // true | |
console.log("apple".includes("a")) // true |
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
<div> | |
<label for="old-pass">Current Password:</label> | |
<input type="password" id="old-pass" autocomplete="current-password"> | |
</div> | |
<div> | |
<label for="new-pass">Choose New Password:</label> | |
<input type="password" id="new-pass" autocomplete="new-password"> | |
</div> |
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
// 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 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
let person = { name: "Frida" } | |
// original | |
person.city = person.city || "unknown" | |
// with logical or assignment operator | |
person.city ||= "unknown" |
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
{ | |
"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 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
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 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 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 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 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 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
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 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
let person = { | |
FirstName: "Ada", | |
LastName: "Lovelace", | |
Password: "********" | |
} | |
console.log(person) | |
// { FirstName: "Ada", LastName: "Lovelace", Password: "********"} | |
delete person.Password |