Samual Sam has Published 2492 Articles

TypedArray.find() function in JavaScript

Samual Sam

Samual Sam

Updated on 25-Jun-2020 13:29:28

19 Views

The find() function of TypedArray accepts a string value representing the name of a function, tests whether the elements in the array passes the test implemented by the provided function, if so, returns the first element which passes the test else, returns undefined.SyntaxIts Syntax is as followstypedArray.find(function_name)Example Live Demo   ... Read More

TypedArray.forEach() function in JavaScript

Samual Sam

Samual Sam

Updated on 25-Jun-2020 13:27:34

29 Views

The forEach() function of TypedArray object accepts a string value representing the name of a function and executes it per every element in the array.SyntaxIts Syntax is as followstypedArray.forEach()Example Live Demo    JavaScript Array every Method           var int32View = new Int32Array([21, 19, 65, ... Read More

Java Program to replace one specific character with another

Samual Sam

Samual Sam

Updated on 25-Jun-2020 13:26:35

509 Views

Use the replace() method to replace a specific character with another. Let’s say the following is our string and here we are replacing a whitespace with a $ character.String str1 = "Orange is the new Black!";Now, use the replace() method to replace a character with $str1.replace(' ', '$');Example Live Demopublic class ... Read More

TypedArray.indexOf() function in JavaScript

Samual Sam

Samual Sam

Updated on 25-Jun-2020 13:25:17

38 Views

The indexOf() function of the TypedArray object accepts a value and verifies whether the typed array contains the specified element. If so, this function returns the index of the array at which the specified element found, if the element occurred multiple timed this function returns the first index among them. ... Read More

TypedArray.keys() function in JavaScript

Samual Sam

Samual Sam

Updated on 25-Jun-2020 13:22:23

30 Views

The keys() function of typedArray object is similar to entries but, it returns an iterator object containing the indices of the typed array.SyntaxIts Syntax is as followstypedArray.keys()Example Live Demo    JavaScript Array every Method           var int32View = new Int32Array([21, 64, 89, 65, 33, ... Read More

Java Program to replace all occurrences of a given character with new character

Samual Sam

Samual Sam

Updated on 25-Jun-2020 13:21:05

290 Views

Let’s say the following is our string.THIS IS DEMO TEXT!Here, to replace every occurrence of ‘I’ with ‘E’, use the replace() method.str.replace('I', 'E'));The following is the complete example to replace all occurrences of a given character with new character.Example Live Demopublic class Demo {    public static void main(String[] args) { ... Read More

TypedArray.map() function in JavaScript

Samual Sam

Samual Sam

Updated on 25-Jun-2020 13:20:09

45 Views

The map() function of the TypedArray object accepts the name of a function and calls it on every element of the typed array and returns the results.SyntaxIts Syntax is as followstypedArray.map()Example Live Demo    JavaScript Array every Method           var int32View = new Int32Array([11, ... Read More

Java program to program to cyclically rotate an array by one

Samual Sam

Samual Sam

Updated on 25-Jun-2020 13:18:13

883 Views

The array is cyclically rotated clockwise by one. This means that each of the array elements are displayed to the right by one and the last element ends up as the first element. An example of this is given as follows.Original array = 1 2 3 4 5 6 7 ... Read More

TypedArray.reverse() function in JavaScript

Samual Sam

Samual Sam

Updated on 25-Jun-2020 13:17:39

44 Views

The reverse() function of the TypedArray object reverses the contents of a typed array.SyntaxIts Syntax is as followstypedArray.reverse()Example Live Demo    JavaScript Array every Method           var typedArray = new Int32Array([11, 5, 13, 4, 15, 3, 17, 2, 19, 8 ]);       ... Read More

TypedArray.BYTES_PER_ELEMENT property in JavaScript

Samual Sam

Samual Sam

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

74 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);       ... Read More

Advertisements