How React serves?When you do. npm start index.html will be served in web browser. Now, index.html contains root dom node and as it served the control goes to it's javascript file which is index.js. Now, the index.js having below rander function. ReactDOM.render( <...Sep 24, 2022·1 min read
Object logging in Console #Node Quick Notes.Remember we require console to debug javascript so below will be Node do not logs objects as javasript does after certain level, to do so use, console.log(JSON.stringify(obj, null, 2)); or set require('util').inspect.defaultOptions.depth = null; if...Sep 11, 2022·1 min read
Error #Node Quick Notes.Errors are handled with exceptions. throw keyword to break normal exectuion of javascript. Node.js has Error class from Error core module. Do, throw Error("My new error message."); or extend class and throw like Class MyCustomError extends Error(){};...Sep 11, 2022·1 min read
Destructuring #React Quick Notes.Remember basic meaning. It means choosing only desire sweets from a cakeshop. Here is an example to remember it. const cakeVarieties = ['Chocolate','KitKat','Mango', 'Brownie']; const [myChoise1, myChoise2, ...rest] = cakeVarieties; console.log(myC...Sep 11, 2022·1 min read
Event Loop #Node.js Quick Notes.Remember below things first before starting understanding Event Loops. The Node.Js JavaScript Code Runs On A Single Thread. Node.Js Call Stack Is A LIFO (Last In, First Out) Stack. When browser loop through events, it gives priority to callstack an...Sep 5, 2022·1 min read
Closures #React Qucik Notes.Why we need to Understand closure? So we can know where to declare variable and which function in nested level can have access to it. For understanding Closure, please refer below link which has provided best documentation to understand. https://de...Sep 4, 2022·1 min read
Promise in Javascript #Node Quick Notes.Take it easy as a javascript if else statement that we use every time whether a condition is true or not. If(we got success in something){ return resolution of successs; }else{ return rejection; } As above same a Promise can be defined but remember t...Sep 4, 2022·1 min read