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
| { | |
| "basics": { | |
| "name": "Thomas Edison", | |
| "label": "Inventor and Businessman", | |
| "picture": "https://example.com/photo.jpg", | |
| "email": "thomas.edison@example.com", | |
| "phone": "(123) 456-7890", | |
| "url": "https://thomasedison.com", | |
| "summary": "Prolific inventor and businessman known for developing many devices that greatly influenced life around the world, including the phonograph, the motion picture camera, and the electric light bulb.", | |
| "location": { |
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
| { | |
| "basics": { | |
| "name": "Thomas Edison", | |
| "label": "Inventor and Businessman", | |
| "picture": "https://example.com/photo.jpg", | |
| "email": "thomas.edison@example.com", | |
| "phone": "(123) 456-7890", | |
| "url": "https://thomasedison.com", | |
| "summary": "Prolific inventor and businessman known for developing many devices that greatly influenced life around the world, including the phonograph, the motion picture camera, and the electric light bulb.", | |
| "location": { |
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 CustomPromiseState = { | |
| PENDING: "PENDING", | |
| RESOLVED: "RESOLVED", | |
| REJECTED: "REJECTED", | |
| }; | |
| class CustomPromise { | |
| constructor(fn) { | |
| this.CustomPromiseState = CustomPromiseState.PENDING; | |
| this.resolver = this.resolver.bind(this); | |
| this.rejector = this.rejector.bind(this); |
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 memoization(func) { | |
| let cache = new Map(); | |
| const getData = () => { | |
| if (cache[func]) { | |
| console.log("cache"); | |
| return cache[func]; | |
| } else { | |
| cache[func] = func(); | |
| console.log("not cache"); | |
| return cache[func]; |