Showing 1 to 10 of 55 posts.

Garbage Collection in JavaScript

Posted on January 18th, 2021 in JavaScript by George

The data created in JavaScript needs memory in order to persist while the program is running. Have you ever asked yourself what happens with the data that is not needed anymore?

Not a sin if you have not. The engine does the job behind the scenes using a form of automatic memory management named garbage collector which has the task of discarding the data that is no more needed by the program.


JavaScript Adapter Pattern

Posted on September 20th, 2020 in JavaScript by George

The "Adapter Pattern" is a structural pattern where the interface of one class is translated into another. This pattern allows classes work together that could not otherwise, because of incompatible interfaces.


Equality, Sort, Range - MongoDB index creation planning

Posted on September 5th, 2020 in JavaScript by George

This post is an example of why in most of the queries that include some sort of equality, range, and sorting, the way you are building your indexes matters.


Hacker Rank Repeated String Solution with JavaScript and comments

Posted on August 13th, 2020 in JavaScript by George

I have added the solution with the explanation in code comments for the Repeated String problem.


6 JavaScript Quirks that every JS developer should know!

Posted on July 4th, 2020 in JavaScript by George

Most of the developers from other languages are ofter too confident to adopt JavaScript just because they master other languages syntax. 

But what do you do when your application misbehaves and at first glance, everything looks right? Could be that you were not aware of some of the JavaScript quirks?

Without further ado, let's dive in.


Project Euler 182 solution JavaScript

Posted on July 3rd, 2020 in JavaScript by George

This is the javascript solution for Project Euler 182.

The final mathematical solution does not belong to me. I have translated the solution from Java to JavaScript from here

I hope this will help others to explore the problem using JavaScript because for some people, the learning process works better through reverse engineering.


React native error "multiple commands produce.." Xcode 11

Posted on May 14th, 2020 in JavaScript, React Native by George

How to solve this issue? See the article


How To Test React Components (hooks, Jest, Enzyme)

Posted on May 4th, 2020 in JavaScript by George

This article explains unit testing, integration testing, the end to end testing, and how to create React Component tests. 

The examples will use Jest and Enzyme for testing and the test components will be written using React hooks.


What are JavaScript generators, function* generator?

Posted on April 27th, 2020 in JavaScript by George

Find out what a function generator looks like and what it is, with examples.

➜  jsstuff node generators.js
First Next Promise { <pending> }
{ name: 'George', age: 30, activityList: [ 'Coding', 'Running' ] }
Second Next { value: 1, done: false }
Third Next { value: '2', done: false }
Fourth Next { value: 'I am done here!', done: false }
Fifth Next { value: undefined, done: true }



JavaScript Singleton (using ES6 class)

Posted on April 16th, 2020 in JavaScript by George

An example of how to implement the Singleton pattern in JavaScript using ES6 class abstraction.