Tips & Tutorials

Javascript Loops & Iterations Cheat Sheet – Simple Examples

Welcome to a beginner’s tutorial on Javascript loops and iterations. Want to loop through arrays, objects, or do things repetitively? The common mechanisms to loop and iterate in Javascript are: For – for (let i=0; i<10; i++) { … } For-In – for (let key in object) { … } For-Of – for (let element of …

Javascript Loops & Iterations Cheat Sheet – Simple Examples Read More »

Delete Files & Folders In NodeJS – Simple Examples

Welcome to a quick tutorial on how to delete files and folders in NodeJS. Need to remove some old or temporary files in Node? To delete files in NodeJS, we can use the unlink function. const fs = require(“fs”) fs.unlink(“PATH/FILE”, (error) => {}) fs.unlinkSync(“PATH/FILE”) To delete (empty) folders in NodeJS, we can use the rmdir …

Delete Files & Folders In NodeJS – Simple Examples Read More »

How Javascript Files Load (Normal vs Async vs Defer)

Welcome to a quick tutorial on how Javascript files are loaded – Normal, async, and defer. Ever since day one of learning Javascript, we were taught to either code Javascript inline or load them from external files. But just how are these Javascript files loaded? This simple question has somehow eluded many beginners, and in short …

How Javascript Files Load (Normal vs Async vs Defer) Read More »

Set & Get HTML Data Attributes In Javascript (Simple Examples)

Welcome to a quick tutorial on how to set and get HTML data attributes in Javascript. Want to insert your own custom property or data into HTML elements? To set HTML data attributes, we simply define data-KEY=”VALUE” in the opening tag. For example, <div data-color=”red”> We can also set HTML data attributes in Javascript using …

Set & Get HTML Data Attributes In Javascript (Simple Examples) Read More »

Get Set Remove HREF In Javascript – Simple Examples

Welcome to a quick tutorial on how to get, set, and remove the href property in Javascript. By now, you should know href very well. That “thing” we use to specify which webpage to link to. But how can we dynamically change or remove it using Javascript? For a quick answer: To get the href …

Get Set Remove HREF In Javascript – Simple Examples Read More »

ABBR vs DFN vs ACRONYM In HTML – Quick Examples

Welcome to a quick tutorial on how to use the <abbr>, <dfn>, and <acronym> HTML tags. With the introduction of HTML5, there have been additions and changes to quite a number of “confusing” semantic tags. In particular, we will address abbreviation, definition, and acronym in this guide: The  HTML <abbr> tag is used to denote …

ABBR vs DFN vs ACRONYM In HTML – Quick Examples Read More »