Closure in JavaScript
Closures in JavaScript are functions that retain access to variables from their containing scope even after the parent function has finished executing. They’re useful for maintaining private data, creating modular code, and implementing callback functions with persistent state. In this article, we’ll dive deep into closures, understand how they work, and explore practical examples....
read more
Use EJS as Template Engine in Node.js
EJS: EJS or Embedded Javascript Templating is a templating engine used by Node.js. Template engine helps to create an HTML template with minimal code. Also, it can inject data into an HTML template on the client side and produce the final HTML. EJS is a simple templating language that is used to generate HTML markup with plain JavaScript. It also helps to embed JavaScript into HTML pages. To begin with, using EJS as templating engine we need to install EJS using the given command:...
read more
HTML rowspan Attribute
The rowspan attribute in HTML specifies the number of rows a cell should span. That is if a row spans two rows, it means it will take up the space of two rows in that table. It allows the single table cell to span the height of more than one cell or row. It provides the same functionality as “merge cell” in a spreadsheet program like Excel....
read more
How to Create a Transparent button using HTML and CSS ?
To create a transparent button using HTML and CSS, you can set the background-color property to have an rgba value with an alpha channel less than 1 (e.g., rgba(0, 0, 0, 0.5) for a semi-transparent black). This allows the underlying content to show through the button, creating a transparent effect....
read more
Node fs.mkdir() Method
The fs.mkdir() method in Node.js is used to create a directory asynchronously....
read more
HTML <table> border Attribute
The HTML <table> border Attribute is used to specify the border of a table. It sets the border around the table cells. This attribute defines the visual presentation of the table by setting the thickness of the borders. A higher value results in a thicker border. Alternatively, setting the border attribute to “0” removes the borders entirely....
read more
How to select multiple options at once in dropdown list in HTML5?
Dropdown lists are one of the most flexible elements in HTML. It is similar to that of the radio input, that is, only one item can be selected from a group of items by default....
read more
HTML <th> width Attribute
The HTML <th> width Attribute is used to specify the width of a table header cell. If the width attribute is not set then it takes the default width according to the content....
read more
How to build a basic CRUD app with Node and React ?
In this article, we will create a basic Student app from scratch using the MERN stack which will implement all the CRUD(Create, Read, Update and Delete) Operations....
read more
Mongoose insertMany() Function
The insertMany() function is used to insert multiple documents into a collection. It accepts an array of documents to insert into the collection. This function is efficient and can significantly speed up the process of adding multiple documents compared to inserting each document individually....
read more
How to create linear gradient text using HTML and CSS ?
The Linear-Gradient is a kind of text-styling in which the text is filled with linear-gradient color codes. These kinds of effects are generally used in dark-themed websites or apps to make the text look attractive and bold. They are almost suitable for dark themes and do not go well with lighter themes....
read more
Difference between em and rem units in CSS
While setting the size of any element in CSS, we have two choices. The first one is absolute units and the other is relative units. Absolute units are fixed and not relative to anything else. They are always identical in any case. They involve cm, mm, px, etc. On the other side, relative units are relative to something else. It may be the size of the parent element or the size of the main HTML. Relative units cover em, rem, vw, vh, etc. These are scalable units and help in responsive design. Many of us might get confused between the relative units, especially the em and the rem units. Let’s break down the difference between those two. Basically that both rem and em are scalable and relative units of size, but with em, the unit is relative to the font size of its parent element, while the rem unit is only relative to the root font size of the HTML document. The “r” in rem stands for “root”....
read more