Found 444 Articles for Programming Scripts

TypedArray.copyWithin() function in JavaScript

karthikeya Boyini
Updated on 25-Jun-2020 13:14:56

71 Views

The copyWithin() function of the TypedArray object copies the contents of this TypedArray within itself. This method accepts three numbers where first number represents the index of the array at which the copying of elements should be started and, the next two numbers represents start and end elements of the array from which the data should be copied (taken).SyntaxIts Syntax is as followsobj.copyWithin(3, 1, 3);Example Live Demo    JavaScript Example           var int32View = new Int32Array([21, 64, 89, 65, 33, 66, 87, 55 ]);       document.write("Contents of the typed array: "+int32View);   ... Read More

TypedArray.byteOffset property in JavaScript

Samual Sam
Updated on 25-Jun-2020 13:15:23

69 Views

The byteOffset property of the TypedArray represents the offset of the current object.SyntaxIts Syntax is as followstypedArray.byteOffset();Example Live Demo    JavaScript Example           var buffer = new ArrayBuffer(156);       var float32 = new Float32Array(buffer);       document.write(float32.byteOffset);     Output0

TypedArray.byteLength property in JavaScript

karthikeya Boyini
Updated on 25-Jun-2020 13:15:45

75 Views

The byteLength property of the TypedArray object represents the length of its(in bytes)TypedArray.SyntaxIts Syntax is as followstypedArray.byteLength();Example Live Demo    JavaScript Example           var buffer = new ArrayBuffer(156);       var float32 = new Float32Array(buffer);       document.write(float32.byteLength);     Output156

TypedArray.buffer property in JavaScript

Samual Sam
Updated on 25-Jun-2020 13:16:09

71 Views

The buffer property of the TypedArray represents the ArrayBuffer of the current TypedArray.SyntaxIts Syntax is as followsobj.buffer;Example Live Demo    JavaScript Example           var buffer = new ArrayBuffer(156);       var float32 = new Float32Array(buffer);       document.write(float32.buffer.byteLength);     Output156

TypedArray.name property in JavaScript

karthikeya Boyini
Updated on 25-Jun-2020 13:16:32

49 Views

The name property of the TypedArray object represents the name of the typed array in string (format)i.e. one of Int8Array, Uint8Array, Uint8ClampedArray, Int16Array, Uint16Array, Int32Array, Uint32Array, Float32Array, Float64Array.SyntaxIts Syntax is as followsFloat32Array.name;Example Live Demo    JavaScript Example           var nameOfarray1 = Float32Array.name;       document.write("name of array1: "+nameOfarray1);       document.write("");       var nameOfarray2 = Int16Array.name;       document.write("name of array2: "+nameOfarray2);     Outputname of array1: Float32Array name of array2: Int16Array

TypedArray.BYTES_PER_ELEMENT property in JavaScript

Samual Sam
Updated on 25-Jun-2020 13:17:09

109 Views

The BYTES_PER_ELEMENT property of the Typed Array represents the number of bytes in each element in it.SyntaxIts Syntax is as followsFloat32Array.BYTES_PER_ELEMENT;Example Live Demo    JavaScript Example           var sizeOfFloat64Array = Float32Array.BYTES_PER_ELEMENT;       document.write("Size of the float 32 array: "+sizeOfFloat64Array);       document.write("");       var sizeOfInt16Array = Int16Array.BYTES_PER_ELEMENT;       document.write("Size of the int 16 array: "+sizeOfInt16Array);     OutputSize of the float 32 array: 4 Size of the int 16 array: 2

decodeURI() function in JavaScript

Samual Sam
Updated on 25-Jun-2020 13:04:20

90 Views

The decodeURI() function accepts a string value representing an encoded URI, decodesit and, returns the resultant string.SyntaxIts Syntax is as followsdecodeURI('http://www.qries.com/');Example    JavaScript Example           var result1 = decodeURI('http://www.qries.com/');       document.write(result1);       document.write("");       var result2 = decodeURI('http://www.tutorialspoint.com/');       document.write(result2);     Outputhttp://www.qries.com/ http://www.tutorialspoint.com/

decodeURIComponent() function in JavaScript

karthikeya Boyini
Updated on 25-Jun-2020 13:04:46

246 Views

The decodeURIComponent() function accepts a string value representing an encoded URI (Uniform Resource Identifier) decodes it and returns the result.SyntaxIts Syntax is as followsencodeURIComponent('http://www.qries.com/');Example Live Demo    JavaScript Example           var encodedData = encodeURIComponent('http://www.qries.com/?x=шеллы');       document.write("Encoded Data: "+encodedData);       document.write("");       var decodedData = decodeURIComponent(encodedData);       document.write("Decoded Data: "+decodedData);     OutputEncoded Data: https%3A%2F%2Ffanyv88.com%3A443%2Fhttp%2Fwww.qries.com%2F%3Fx%3D%D1%88%D0%B5%D0%BB%D0%BB%D1%8B Decoded Data: http://www.qries.com/?x=шеллы

encodeURI() function in JavaScript

Samual Sam
Updated on 25-Jun-2020 13:05:23

118 Views

The encodeURI() function accepts a string value representing an URI and encodes it by replacing the characters in it using numbers (1 to 4) and escape sequence.SyntaxIts Syntax is as followsencodeURIComponent('http://www.qries.com/');Example Live Demo    JavaScript Example           var result1 = encodeURI('http://www.qries.com/?x=шеллы');       document.write(result1);       document.write("");       var result2 = encodeURI('http://www.tutorialspoint.com/?x=шеллы');       document.write(result2);     Outputhttp://www.qries.com/?x=%D1%88%D0%B5%D0%BB%D0%BB%D1%8B http://www.tutorialspoint.com/?x=%D1%88%D0%B5%D0%BB%D0%BB%D1%8B

encodeURIComponent() function in JavaScript

karthikeya Boyini
Updated on 25-Jun-2020 13:06:05

99 Views

The encodeURIComponent() function accepts a string value representing an URI and encodes it by replacing the characters in it using numbers (1 to 4) and escape sequence.SyntaxIts Syntax is as followsencodeURIComponent('http://www.qries.com/');Example Live Demo    JavaScript Example           var result1 = encodeURIComponent('http://www.qries.com/');       document.write(result1);       document.write("");       var result2 = encodeURIComponent('http://www.tutorialspoint.com/');       document.write(encodeURIComponent(result2));     Outputhttps%3A%2F%2Ffanyv88.com%3A443%2Fhttp%2Fwww.qries.com%2F http%253A%252F%252Fwww.tutorialspoint.com%252F

Advertisements