Skip to content

Instantly share code, notes, and snippets.

@itaditya
Last active June 7, 2020 13:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save itaditya/6dfce9abecc8cbf54a763de3521e3559 to your computer and use it in GitHub Desktop.
Save itaditya/6dfce9abecc8cbf54a763de3521e3559 to your computer and use it in GitHub Desktop.
Blog- Optimizing React apps with Memo
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