Skip to main content

Command Palette

Search for a command to run...

Shallow Comparison(Primitive Values)

Updated
1 min readView as Markdown
Shallow Comparison(Primitive Values)

Shallow comparison is when the properties of the objects being compared is done using "===" , for Example when we compare the previousprops and nextprops in React component , if there are equal nothing is rendered.

The Shallow comparison is when you compare the primitive values like numbers , boolean , Strings . undefined and null are additional primitive types.

Note: Function , Objects and Array are a reference types not primitive (unprimitive).

more info : https://academind.com/tutorials/reference-vs-primitive-values

Screenshot (263).png

More from this blog

Omar's blog

135 posts