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 A(){}; // function declaration | |
var B = function(){}; // function expression | |
var C = (function(){}); // function expression with grouping operators | |
var D = function foo(){}; // named function expression | |
var E = (function(){ // IIFE that returns a function | |
return function(){} | |
})(); | |
var F = new Function(); // Function constructor | |
var G = new function(){}; // special case: object constructor | |
var H = x => x * 2; // ES6 arrow function |
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
//step 1: Inside package.json add proxy key | |
// eg: "proxy": "http://jsonplaceholder.typicode.com" | |
//step 2: sample program to retrive from jsonplaceholder | |
(async()=>{ | |
const apiData = await fetch('/users'); | |
const json = await apiData.json(); | |
console.log("JJJ:", json); |
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
// https://elijahmanor.com/cra-debug-vscode/ | |
{ | |
"version": "0.2.0", | |
"configurations": [ | |
{ | |
"name": "Debug CRA Tests", | |
"type": "node", | |
"request": "launch", | |
"runtimeExecutable": "${workspaceRoot}/node_modules/.bin/react-scripts", |
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
<script> | |
let counter = 0; | |
const debounce = (fn, delay) => { | |
let timeoutId; | |
return () => { | |
clearTimeout(timeoutId); | |
timeoutId = setTimeout(fn, delay); | |
} |
OlderNewer