In this blog post, I am going to briefly define closure and showcase how React hook UseState works under the hood.

useState hook comes in very handy in a toggle button situation

So first what is closure?

We can think about it just like MDN defines it as the combination of a function bundled together (enclosed) with references to its surrounding state (the lexical environment). In other words, closure is when a function is able to remember its lexical scope even when that function is executing outside its lexical scope.

The word “lexical” refers to the fact that lexical scoping uses the location where a variable is declared within the source code to determine where that…


Hoisting Javascript, Nguyễn Quang Vinh

Hoisting is a JS default behavior of defining all the declarations at the top of the scope before code execution. Its main benefit is enabling us to call functions before they appear in the code.

I noticed during my first month of coding Vanilla JS that, not fully understanding the concept of hoisting could cause a lot of issues/bugs/errors down the road. Through this blog, I am going to explain what goes under the hood of JS hoisting.

When you execute a piece of JavaScript code, the JavaScript engine creates the global execution context .

There are two phases in…


Photo by Michael Hodgson, New York 2019

Ruby on Rails or Rails is a user-friendly open source framework. Its main goal is to optimize the web application development process.

Rails developers must follow standard best practice conventions in order for the magic to happen. Rails is built on the principle of convention over configuration (for example: a model is singular — a controller is plural).

Generators are a nifty way of integrating standard features that help creating CRUD functionalities in an application. So instead of having to build them manually each time, Rails came out with a faster automated way. …

Noura Loudani

Software Engineering

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store