Posts

Showing posts from July 2, 2021

JavaScript Closures

  Closure is one of the important concept of Javascript. A closure is a function which has access to all variables from the other function. In other words, a closure is child functions which have access to all variables of their parent function. This is been done by creating a function inside the other function and most importantly they outer/ parent function is n ot able to access to the scope of inner/child function. In Javascript, the variable scope is either local or global. Local Variable: variables declared inside the function, function can full access to it. That is a local variable. e.g.       <!DOCTYPE html> <html> <body> <p id="demo"></p> <script>   function add() {             let a=2;             document.getElementById("demo").innerHTML=a*a; } add(); </script> </body> </html> Output: 4 Global Variable: A function can access the variable defined outside the func

The Art of Managing Time: A Relative Perspective

 It’s been over 4.5 billion years since the creation of this magnificent planet named Earth. Different species, dynasties, periods existed here but after a specific period of time everything vanished giving a rise to more advanced successors. Between these transitions there was one thing which was constant and till date it is unaffected by the changes no matter what were the circumstances and adversities were there and that immortal entity is “TIME”. In every other sculpture, book, lesson, holy book etc. the thing which is preached and emphasized upon is the importance of time , its’s unpredictability and management . No one can predict the event which is going place in the very next second. There are chances that at one instance you may be enjoying the hot pursuit of your sports car and at very next instance you might crash your most loved machine at a turn. There is a possibility that on a normal day you are following your daily routine and engaged in regular chores and on the very n