Front End Scripts Articles

Found 465 articles

JavaScript Program to Find Minimum Insertions to Form a Palindrome

Prabhdeep Singh
Prabhdeep Singh
Updated on 15-Mar-2026 309 Views

We are given a string and we have to find the minimum number of characters that we need to insert at any position to make the string a palindrome. A palindrome is a string that reads the same forwards and backwards. This problem can be solved using dynamic programming - we'll explore three approaches: recursive, memoization, and tabulation. Understanding the Problem For example, to make "abc" a palindrome, we need to insert 2 characters to get "abcba" or "cbabc". The key insight is that if characters at both ends match, we can focus on the substring between them. ...

Read More

Sorting a JSON object in JavaScript

AmitDiwan
AmitDiwan
Updated on 15-Mar-2026 4K+ Views

In JavaScript, objects themselves cannot be sorted since their properties don't have a guaranteed order. However, we can extract the values from a JSON object and sort them into an array. Suppose we have an object like this: const obj = { key1: 56, key2: 67, key3: 23, key4: 11, key5: 88 }; We need to write a JavaScript function that takes this object and returns a sorted array of its values: const arr = [11, 23, 56, ...

Read More

ES6 Default Parameters in nested objects – JavaScript

AmitDiwan
AmitDiwan
Updated on 15-Mar-2026 631 Views

ES6 allows you to set default parameters for nested objects using destructuring assignment. This feature helps handle cases where nested properties might be undefined or missing. Syntax function myFunction({ outerKey: { innerProperty = defaultValue, anotherProperty = anotherDefault } = {} } = {}) { // Function body } Example Here's how to implement default parameters in nested objects: function ...

Read More

How to design a modern Website?

Ali
Ali
Updated on 15-Mar-2026 264 Views

Modern websites are responsive and the design works fine on multiple devices such as Desktop, Tablet, and Mobile. Also, websites these days do not follow the old font styles, many of them use Google fonts since it's easy to find a font-face matching your website's content and Google provides a lot of free fonts to choose from. Modern websites display beautifully formatted content on multiple devices such phones, tablets, and desktops. Also, nowadays Retina-ready logos help in keeping your logo amazing, no matter the resolution. Follow the below given steps and learn how to design a modern website: ...

Read More

How to set the widths of the image border with JavaScript?

Shubham Vora
Shubham Vora
Updated on 15-Mar-2026 543 Views

In this tutorial, we shall learn to set the widths of the image border with JavaScript. To set the widths of the image border, use the borderImageWidth property in JavaScript. When we need an image as a border of our webpage content, we have to see how to set the width of the image border. Using the Style borderImageWidth Property With the Style borderImageWidth property, we can set or return the widths of the image border of an element. The border image will range beyond the padding when the border image width is greater than the ...

Read More

How to set the size of the background image with JavaScript?

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

In this tutorial, we will look at the method to set the size of a background image with JavaScript. Background effects on a webpage enhance its look. We can set a background color or a background image to enhance the feel of the webpage. We can also change the background properties, like its size or color. To enhance the feel, the image must fit in the right position with the right size. Generally, we do this by using CSS, but JavaScript DOM also provides properties to do so. So, let us look at how to set the ...

Read More

How to set whether the image-border should be repeated, rounded or stretched with JavaScript?

Shubham Vora
Shubham Vora
Updated on 15-Mar-2026 235 Views

This tutorial will teach us to set whether the border image should be repeated, rounded, or stretched with JavaScript. Use the borderImageRepeat property to set whether the image-border is to be repeated, rounded, or stretched. Borders are used to decorate or focus an element. You can define its width, color, and type of border. Various styles can be applied to the borders. But, these borders are without any special effects or any other designs. Using the border-image property, we can set an image as a border of an element. It does not look like a line. It will ...

Read More

Client-side image processing with HTML

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

Client-side image processing allows you to manipulate images directly in the browser using HTML, CSS, and JavaScript without server uploads. This approach provides instant feedback and reduces server load. HTML Structure for Image Processing Start with a basic HTML structure that includes file input and canvas elements: Client-side Image Processing Image Processing Demo ...

Read More

Splitting and uploading extremely large files to Amazon S3

Sravani S
Sravani S
Updated on 15-Mar-2026 686 Views

When dealing with extremely large files (10+ GB), uploading directly to Amazon S3 can be challenging due to network timeouts and bandwidth limitations. Amazon S3's multipart upload feature provides a robust solution by splitting large files into smaller chunks that can be uploaded independently and in parallel. How Multipart Upload Works The process involves three main steps: Initiate: Start a multipart upload session with S3 Upload Parts: Split the file into chunks and upload each part independently Complete: Combine all parts into the final object ...

Read More

How to set an image as the list-item marker with JavaScript?

Monica Mona
Monica Mona
Updated on 15-Mar-2026 212 Views

To set an image as the marker in list items, use the listStyleImage property in JavaScript. This property allows you to replace default list markers (bullets or numbers) with custom images. Syntax element.style.listStyleImage = "url('image-path')"; Example The following example demonstrates how to set a custom image as the list-item marker: First Item Second Item Third Item ...

Read More
Showing 1–10 of 465 articles
« Prev 1 2 3 4 5 47 Next »
Advertisements