
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Found 10483 Articles for Web Development

369 Views
We will learn how to utilise imports and exports in javascript in this post, as well as how to use them to break our code into different modules in order to better organise it. To facilitate modular development in programming, which enables us to organise our code into reusable modules, JavaScript provides exports and imports. To achieve this sharing and reusability of code, we can use different types of exports and imports. Exports allow us to make functions, variables, objects, or any values available outside of a module. By marking components as exports, we can expose them for use in ... Read More

229 Views
Following is the code to pass JavaScript primitive and object types to function −Example Live Demo Document body { font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif; } .result { font-size: 18px; font-weight: 500; color: blueviolet; } Passing primitive/object types to function Click here Click on the above button to pass primitive and object to a function and call it let BtnEle = document.querySelector(".Btn"); let resEle = document.querySelector(".result"); let person = { ... Read More

839 Views
In this article, we will learn about the various ways to define and declare variables in javascript, and how we can use them to implement state management in our applications. In javascript, variables can be thought of as containers that hold values, and which can be retrieved later on in the application. There are several ways to define a variable, each with its own syntax and use cases. Let’s understand different methods of doing so with the help of some examples to understand the concept better. Example 1: Using the var keyword The “var” variable has function scope, which means ... Read More

5K+ Views
In this article, we will learn how to read cookies in javascript, and how we can use it to implement certain features such as user tracking, user preference, personalized experience, etc. Cookies are small pieces of data stored in a user's web browser. In javascript, we can read cookies using document's cookie property and extract the desired information using destructuring. Let’s look at some of the examples to understand the concept better − Example 1 - Reading All Cookies In this example, we will − read all cookies by accessing the document.cookie property and log them to the console. ... Read More

1K+ Views
innerHTML − The innerHTML property returns the text, including all spacing and inner element tags. It preserves the formatting of the text and all the extra tags like , etc.innerText − The innerText property returns just the text, removing the spacing and the inner element tags.Following is the code for innerHTML and innerText in JavaScript −Example Live Demo Document body { font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif; } .result, .sample { font-size: 18px; font-weight: 500; color: red; ... Read More

1K+ Views
Undeclared − It occurs when a variable which hasn’t been declared using var, let or const is being tried to access.Undefined − It occurs when a variable has been declared using var, let or const but isn’t given a value.Following is the code for undeclared and undefined in JavaScript −Example Live Demo Document body { font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif; } .result { font-size: 18px; font-weight: 500; color: blueviolet; } Undeclared vs Undefined ... Read More

979 Views
Following is the code for validating a file size in JavaScript while uploading −Example Live Demo Document body { font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif; } .result { font-size: 18px; font-weight: 500; color: blueviolet; } Validating a file size while uploading Upload a file using the above file input type let BtnEle = document.querySelector(".Btn"); let resEle = document.querySelector(".result"); let fileEle = document.querySelector(".file"); function validateFile() { if ... Read More

683 Views
In JavaScript, functions can be assigned to any variables, they can be passed as arguments to other functions, and can even be returned from other functions. This behavior of functions allow us create HOCs in javascript, which are functions that return other functions. These higher−order functions can be used in various applications like callback functions, function memoization, or transformation, etc. In this article, we will learn functions returning another function, aka higher−order functions in javascript, and how we use them to implement certain javascript features like callbacks, array/object filtering and transformations, etc. Let’s look at some of the examples to ... Read More

5K+ Views
Loops are used in JavaScript to repeat actions or iterate over a piece of data. With the aid of various techniques, we can add a delay between each iteration of the loop in order to regulate the speed of execution or produce particular temporal effects. This article will teach you how to include a delay in a java script loop and how to use it to delay the execution of a specific piece of code that is running inside one. Let’s look at some of the examples to understand the concept better − Example 1 - Using setTimeout() In the ... Read More

530 Views
We will learn how to check or uncheck checkboxes in javascript in this article, and how we can use it to allow users to make multiple selections on the web page Checboxes are one of the most used HTML elements in forms and user interfaces that allow users to pick numerous options. In JavaScript, we can dynamically check or uncheck checkboxes based on certain conditions or user interactions. Let’s look at some of the examples to understand the concept better − Example 1 In this example, we will − We will create 3 different checkboxes, a checkAll() and ... Read More