Posts in Category: vanilla js


Diving deep into JavaScript array – evolution & performance

Before starting the article I would like to state that this is not about the basic of JavaScript array. Neither about teaching syntaxes or showing usage examples. The article is more about memory representation, optimization, behavior differences over syntaxes, performance and the recent evolution. When I started using JavaScript for the

Read More



import vs require – ESM & commonJs module differences

ECMAScript Modules (ESM) are still in stage 3 (not finalized). require import Dynamic evaluation Static evaluation Throws error at runtime Throws error while parsing Non lexical Lexical As Node.js uses commonJS moduling, I will refer to the workflow of node to address the commonJS modules. And will refer the ECMAScript modules as ESM. Syntax difference CommonJS dep.js app.js ESM dep.js app.js Loading technique difference What Node.js does with

Read More




Explaining padStart & padEnd – two ES8 string methods

EcmaScript 2017 or ES8 has introduced two new String prototype methods. padStart and padEnd. Both of them will be used in display related purpose. Even the name says it’s all about “padding”. You can add some extra spaces or dashes (or any other character), before of after a string.

Read More