Learning Js in one hour is like day dream.
Hoisting was a by product. It something brings some weird bugs that is really heard to find out.
Closure is another thinks that is really hard to understand for new comer.
If you console log typeof null. It will show Object. But it is not. It’s a bug which never gone fixed for legacy purposes.
This keyword works lightly different in js. Which is a great source of confusion.
.1+.2 = 0.30000000000000004. Isn’t it wired?
React build a virtual dom. With this DOM react select which element should be rendered and which one should not.
React also has some kind of special thing which is called hooks. with the help of virtual dom hook identify exactly which element should be rendered.
useEffect is used for fetching data, rendering thing for specific changes.
useState is used for storing data.
useRef is used for selecting specific element.
useReducer is used for storing data.
useHistory is used fot getting location.
Hold on! You might ask what’s that ?
well, multi paradigm means the pattern of coding. In JS there have 3 types of programming pattern.
1. Procedural programming
2. Functional programming (current pattern of react components)
3. class based programming ( earlier pattern of react components)
Single threaded means programs are run one after another. JIT (just in time) compiled actually compensate single threaded functionality . JIT run the programs once and make a small executable file that can be execute any time.
map: map is a higher order function that takes a function as an input. This function loop through all array element and can do
some operations with each element. this returns a new array with new elements.
Return: returns a new array.
Time complexity: As it loop through all the elements of the array, So it’s time complexity is BIG O(n)
filter: Filter is another array method that takes an callback function and do some kind of condition. …
Front End Web Developer