Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
-
Economics & Finance
Articles by Lokesh Badavath
Page 7 of 7
How to understand JavaScript module pattern?
The JavaScript Module Pattern is a design pattern that encapsulates private and public methods and variables within a single object. It provides a way to create modular, maintainable code while avoiding global namespace pollution. What is the Module Pattern? The Module pattern uses Immediately Invoked Function Expressions (IIFE) to create a closure that contains private variables and functions. It returns an object with public methods that can access these private elements. Why Use the Module Pattern? Maintainability − Modules are self-contained and reduce dependencies, making code easier to maintain and improve independently. Namespace Protection − ...
Read MoreHow to read data from *.CSV file using JavaScript?
In this article, we are going to learn how to read data from *.CSV file using JavaScript. To convert or parse CSV data into an array, we need JavaScript's FileReader class, which contains a method called readAsText() that will read a CSV file content and parse the results as string text. If we have the string, we can create a custom function to turn the string into an array. To read a CSV file, first we need to accept the file. Now let's see how to accept the csv file from browser using HTML elements. ...
Read MoreHow to get the body's content of an iframe in JavaScript?
To get the body's content of an iframe in JavaScript, you need to access the iframe element first, then navigate to its document and retrieve the body content. This requires the iframe to be from the same origin due to browser security policies. Basic Approach First, get the iframe element using document.getElementById(), then access its content through contentWindow.document or contentDocument: Get Iframe Content Get Iframe Content ...
Read MoreWhat is JavaScript AES Encryption?
AES (Advanced Encryption Standard) is a symmetric encryption algorithm that uses the same key to encrypt and decrypt data. In JavaScript, we can implement AES encryption using libraries like CryptoJS to secure sensitive information in web applications. What is AES Encryption? AES is a widely adopted encryption standard that provides strong security for data protection. It's called "symmetric" because the same key is used for both encryption and decryption processes. This algorithm is commonly used in messaging applications like WhatsApp and Signal to ensure secure communication. How AES Works The encryption process involves converting plain text ...
Read MoreAdding an element at the end of the array in Javascript
In JavaScript, adding elements to the end of an array is a fundamental operation. The most common and efficient method is using the push() method, which modifies the original array by appending one or more elements. An array is a special variable that can hold multiple values in a single ordered collection. Arrays in JavaScript are dynamic, meaning you can add or remove elements after creation. What is an Array? An array is a collection of items stored at contiguous memory locations. Arrays allow random access to elements, making it faster to access elements by their position ...
Read MoreAdding an element at the start of the array in Javascript
In JavaScript, adding an element at the start of an array is a common operation. The most straightforward method is using the unshift() method, which adds one or more elements to the beginning of an array and returns the new length. An array is a data structure that stores multiple values in a single variable. Arrays in JavaScript are zero-indexed, meaning the first element is at position 0. Syntax array.unshift(element1, element2, ..., elementN) Parameters The unshift() method accepts one or more parameters representing the elements to add at the beginning of the array. ...
Read MoreHow to iterate a JavaScript object's properties using jQuery?
In this article, we are going to learn how to iterate a JavaScript object’s properties using jQuery. The simplest way to iterate over an object with JavaScript is to use a for in loop. The for statement will iterate over the objects as an array, but the loop will send the key to the object instead of an index as a parameter. This loop is used to iterate over all non-Symbol iterative properties of an object. The hasOwnProperty() method can be used to check if the property belongs to the object itself. The value of each key of the ...
Read More