Last active
June 7, 2020 13:27
-
-
Save itaditya/6dfce9abecc8cbf54a763de3521e3559 to your computer and use it in GitHub Desktop.
Blog- Optimizing React apps with Memo
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 funcObj() { | |
return { | |
ans: 42, | |
}; | |
} | |
function funcArr() { | |
return [42]; | |
} | |
function funcFunc() { | |
const sum = () => { | |
console.log('I am sum function'); | |
} | |
return sum; | |
} | |
const multiply = () => { | |
console.log('I am multiply function'); | |
} | |
function funcKey() { | |
return multiply; | |
} | |
console.log(funcObj() === funcObj()); // false | |
console.log(funcArr() === funcArr()); // false | |
console.log(funcFunc() === funcFunc()); // false | |
console.log(funcKey() === funcKey()); // true |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment