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> | |
<!-- this comment is a child of the document --> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8" /> | |
<title>Nodelists Versus HTMLCollections</title> | |
<meta name="viewport" content="width=device-width" /> | |
<!-- This comment is a child element of the head element --> | |
</head> | |
<!-- this comment is a child of the html element --> |
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
// https://youtu.be/D-JIYZhEqv8 | |
// The Async Features You’ve Been Awaiting - Yael Hermon | |
function foo() { | |
getSomeAsyncStuff() | |
.then(getSomeMoreAsyncStuff) | |
.then(getSomeMoreAsyncStuff) | |
.then(result=> console.log(result)) | |
.catch((err) => console.log(err);); | |
} |
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
/** | |
* Utils | |
* | |
* Provides utility and miscellaneous functionality. | |
*/ | |
import uuid from 'uuid/v4' | |
/** | |
* Generates a random integer between min and max inclusive. |
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
import "./App.css"; | |
function App() { | |
// const handleIt = (e: any, v: number) => { | |
// console.log(e, v) | |
// } | |
const handleIt = (v) => { | |
return (e) => { | |
console.log(e, v); |
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
/* Child Component */ | |
import React, { Component } from "react"; | |
class Counter extends Component { | |
render() { | |
const { onDelete } = this.props; | |
return ( | |
<button | |
onClick={() => onDelete(counter.id)} | |
className="btn btn-danger btn-sm m-2" |
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
const style = +process.argv[2] || 0; | |
const count = +process.argv[3] || 1000; | |
const propCount = +process.argv[4] || 5; | |
class Foo2 { | |
constructor(a, b) { | |
if (a instanceof Foo2) { | |
this.myItem = a.myNumber * b % 42069; | |
} else { | |
this.myItem = a * b; |
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
/* https://twitter.com/i/status/1553175201357221893 */ | |
{ | |
0% { opacity: 0; clip-path: inset(5%); transform: scale(111.11%) } | |
100% { opacity: 1; clip-path: inset(0); transform: scale(1) } | |
} |
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
const times10 = (num) => { | |
const a = num * 10; | |
return a; | |
}; | |
console.log(`~~~~~~~~TASK 1~~~~~~~~`); | |
console.log(`times10 returns: ${times10(9)}`); | |
const cache = {}; | |
const memoTimes10 = (n) => { |
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
const memoizedClosureTimes10 = () => { | |
let cache = {}; | |
return (n) => { | |
if (n in cache) { | |
console.log(`Fetching from cache: ${n}`); | |
return cache[n]; | |
} else { | |
console.log(`Calculating result~~`); | |
let result = n * 10; |
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
function joinElements(arr, joinString) { | |
function recurse(i, resultSoFar) { | |
resultSoFar += arr[i]; | |
console.log(resultSoFar); | |
if (i === arr.length - 1) { | |
return resultSoFar; | |
} else { | |
return recurse(i + 1, resultSoFar + joinString); | |
} | |
} |
OlderNewer