Web Development Articles

Page 357 of 801

How to manipulate JavaScript's Date object?

Shubham Vora
Shubham Vora
Updated on 15-Mar-2026 3K+ Views

JavaScript's Date object provides powerful methods to manipulate dates and times. You can use getter methods to retrieve date components and setter methods to modify them. Understanding these methods is essential for effective date manipulation in JavaScript applications. Once a Date object is created, numerous methods allow you to operate on it. Most methods let you get and set the year, month, day, hour, minute, second, and millisecond fields using either local time or UTC (universal, or GMT) time. Common Date Methods Here are the key methods used with Date objects: Sr.No Methods ...

Read More

What is the difference between custom and built-in functions in JavaScript?

Anvi Jain
Anvi Jain
Updated on 15-Mar-2026 800 Views

JavaScript functions are divided into two main categories: custom (user-defined) functions and built-in functions. Understanding the difference helps you leverage JavaScript's capabilities effectively. Custom Functions (User-Defined) Custom functions are created by developers to perform specific tasks. You define the logic, parameters, and return values according to your needs. Syntax function functionName(parameter1, parameter2) { // Your custom logic here return result; } Example: Custom Function Custom Function Example ...

Read More

How to set the CSS margin properties in one declaration?

George John
George John
Updated on 15-Mar-2026 357 Views

The margin property defines the space around an HTML element. It is possible to use negative values to overlap content. It specifies a shorthand property for setting the margin properties in one declaration. Syntax margin: value; margin: top right bottom left; margin: top horizontal bottom; margin: vertical horizontal; Margin Value Patterns The margin property accepts 1 to 4 values with different behaviors: Values Result Example 1 value All sides same margin: 20px 2 values vertical | horizontal margin: 10px 5px 3 values top | horizontal ...

Read More

How to invoke a JavaScript Function as a method?

Shubham Vora
Shubham Vora
Updated on 15-Mar-2026 2K+ Views

In this tutorial, we will learn how to invoke a JavaScript Function as a method. In JavaScript, the code inside a function will execute when the function is invoked. We can invoke a function in a variety of ways. One of them is using the method. The method is a property of an object that has a function value. We can define functions as object methods. This function will have a function name, a parameter (optional), and a return type (optional). It will have a "this" keyword which refers to an object. Users can follow the syntax below ...

Read More

How can we assign a function to a variable in JavaScript?

Shubham Vora
Shubham Vora
Updated on 15-Mar-2026 27K+ Views

In this tutorial, we will learn to assign a function to a variable in JavaScript. Functions are reusable code blocks that can be stored in variables as expressions. There are two main ways to achieve this: using anonymous functions and arrow functions. Most JavaScript programmers are familiar with named functions, which follow this syntax: function function_name() { // function body } However, when we want to assign a function to a variable as an expression, we have two different approaches: Creating Anonymous Functions ...

Read More

Set Outset border with CSS

Samual Sam
Samual Sam
Updated on 15-Mar-2026 542 Views

To set an outset border with CSS, use the border-style property with the value outset. An outset border creates a 3D effect that makes the element appear raised or protruding from the page. Syntax border-style: outset; /* Or combine with width and color */ border: width outset color; Example Outset Border Example This paragraph has no border. ...

Read More

How can we use a JavaScript function as an object?

Shubham Vora
Shubham Vora
Updated on 15-Mar-2026 2K+ Views

This tutorial will teach us to use JavaScript functions as objects. In JavaScript, functions are first-class objects, meaning they can have properties and methods just like regular objects. This powerful feature allows us to create constructor functions that act as blueprints for creating multiple similar objects. The JavaScript object is an entity that contains key-value pairs with unique keys. Each key has values that can be of any type. We can access object values using their keys. We can create a function that behaves like an object using the this keyword and the new operator. Below is a ...

Read More

How to define custom JavaScript exceptions?

V Jyothi
V Jyothi
Updated on 15-Mar-2026 242 Views

Custom JavaScript exceptions allow you to create specific error types for your application. You can throw custom error messages or create custom error classes for better error handling. Basic Custom Exception with String The simplest way to create a custom exception is by throwing a string message: function divide(a, b) { try { ...

Read More

Change the width of the bottom border with CSS

karthikeya Boyini
karthikeya Boyini
Updated on 15-Mar-2026 244 Views

The border-bottom-width CSS property controls the thickness of an element's bottom border. This property only works when a border style is defined, as borders are invisible by default. Syntax border-bottom-width: value; Common values include thin, medium, thick, or specific measurements like 1px, 5px, 0.5em. Example This is demo content with a 6px bottom border. ...

Read More

How to catch any JavaScript exception in Clojurescript?

Sravani Alamanda
Sravani Alamanda
Updated on 15-Mar-2026 295 Views

ClojureScript is a dialect of the Clojure programming language that compiles to JavaScript, allowing developers to use Clojure's functional programming paradigms in web browsers and Node.js environments. When building ClojureScript applications, proper exception handling is crucial for maintaining application stability and user experience. What is ClojureScript? ClojureScript is a compiler that transforms Clojure code into optimized JavaScript. Originally, Clojure only compiled to Java Virtual Machine bytecode, but ClojureScript emerged in 2011 to bring Clojure's powerful features to client-side development. ClojureScript operates at a higher abstraction level than JavaScript. While JavaScript deals with variables, loops, conditions, and objects, ...

Read More
Showing 3561–3570 of 8,010 articles
« Prev 1 355 356 357 358 359 801 Next »
Advertisements