karthikeya Boyini

karthikeya Boyini

1,421 Articles Published

Articles by karthikeya Boyini

Page 41 of 143

What will happen when 0 is converted to Number in JavaScript?

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

Use the Number() method in JavaScript to convert values to Number type. When converting 0 to Number, it remains 0 since it's already a valid number. Basic Conversion Converting 0 to Number returns 0, as zero is already a number: Convert 0 to Number var myVal = 0; document.write("Number: " + Number(myVal)); ...

Read More

SharedArrayBuffer.byteLength Property in JavaScript

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

The byteLength property of the SharedArrayBuffer returns an unsigned, 32-bit integer that specifies the size/length of a SharedArrayBuffer in bytes. Syntax sharedArrayBuffer.byteLength Parameters This property takes no parameters and is read-only. Return Value Returns the length of the SharedArrayBuffer in bytes as a 32-bit unsigned integer. Example JavaScript Example var sharedArrayBuffer = new SharedArrayBuffer(8); ...

Read More

Set the background color of an element with CSS

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

To set the background color of an element, use the background-color property in CSS. This property accepts color values in various formats including color names, hex codes, RGB, and HSL values. Syntax background-color: color-value; Example Here's how to set background colors using different methods: Background Color Example This text has a blue background color. ...

Read More

parseFloat() function in JavaScript

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

The parseFloat() function parses a string and returns a floating-point number. It reads the string from left to right until it encounters a character that cannot be part of a number. Syntax parseFloat(string) Parameters The function takes only one parameter: string - The string to be parsed into a floating-point number Return Value Returns a floating-point number parsed from the string. If the first character cannot be converted to a number, it returns NaN. Example: Basic Usage JavaScript parseFloat Example ...

Read More

isFinite() function in JavaScript

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

The isFinite() function accepts a value and determines whether the given value is a finite number or not. If so, this method returns true, else it returns false. You can also invoke this method using the Number object as Number.isFinite(). Syntax isFinite(value) Number.isFinite(value) Parameters value: The value to be tested for finiteness. Return Value Returns true if the value is a finite number, false otherwise. Example: Basic Usage JavaScript Example ...

Read More

encodeURIComponent() function in JavaScript

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

The encodeURIComponent() function accepts a string representing a URI component and encodes it by replacing special characters with percent-encoded sequences. This is essential for safely passing data in URLs. Syntax encodeURIComponent(uriComponent) Parameters uriComponent: A string to be encoded as a URI component. Return Value Returns a new string representing the encoded URI component with special characters replaced by percent-encoded sequences. Example 1: Basic Usage JavaScript Example var url = 'http://www.tutorialspoint.com/'; ...

Read More

decodeURIComponent() function in JavaScript

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

The decodeURIComponent() function accepts a string value representing an encoded URI (Uniform Resource Identifier), decodes it, and returns the result. It reverses the encoding done by encodeURIComponent(). Syntax decodeURIComponent(encodedURI) Parameters encodedURI: A string representing an encoded URI component that you want to decode. Return Value Returns a new string representing the decoded version of the given encoded URI component. Example JavaScript Example var encodedData = encodeURIComponent('http://www.qries.com/?x=шеллы'); ...

Read More

TypedArray.name property in JavaScript

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

The name property of TypedArray constructors returns a string representing the name of the typed array type. This property is available on all TypedArray constructors like Int8Array, Uint8Array, Float32Array, etc. Syntax TypedArrayConstructor.name Where TypedArrayConstructor is one of: Int8Array, Uint8Array, Uint8ClampedArray, Int16Array, Uint16Array, Int32Array, Uint32Array, Float32Array, Float64Array, or BigInt64Array, BigUint64Array. Return Value Returns a string containing the name of the TypedArray constructor. Example TypedArray name Property var nameOfarray1 = Float32Array.name; ...

Read More

TypedArray.byteLength property in JavaScript

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

The byteLength property of the TypedArray object represents the length of the TypedArray in bytes. It is a read-only property that returns the size of the underlying buffer used by the typed array. Syntax typedArray.byteLength Example: Basic Usage JavaScript Example var buffer = new ArrayBuffer(156); var float32 = new Float32Array(buffer); document.write("ByteLength: " + float32.byteLength); ...

Read More

How to delete Web Storage?

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

Web Storage provides methods to delete stored data from both Local Storage and Session Storage. Understanding how to properly clear this data is essential for maintaining user privacy and managing storage space effectively. Removing Individual Items To delete a specific item from storage, use the removeItem() method with the key name: // Store some data first localStorage.setItem('username', 'john'); localStorage.setItem('theme', 'dark'); ...

Read More
Showing 401–410 of 1,421 articles
« Prev 1 39 40 41 42 43 143 Next »
Advertisements