JavaScript DataView.getFloat64()

The JavaScript DataView.getFloat64() inserts a signed 64-bit float number at a specified location. Range of 64-bit float number: -1.7+308 to +1.7E+308 Syntax: dataview.getFloat64 (byteOffset) Parameters: byteoffset: It represents the offset (in bytes) from the start of the data view. Return: Signed float number of 64-bit. Example: <!DOCTYPE html> <html> <body> <script> var dv = new … Read more

JavaScript DataView.getFloat32()

The JavaScript DataView.getFloat32() inserts a signed 32-bit float number at a specified location. Range of 32-bit float number: -3.4+38 to +3.4E+38 Syntax: dataview.getFloat32 (byteOffset) Parameters: byteoffset: It represents the offset (in bytes) from the start of the data view. Return: Signed float number of 32-bit. Example: <!DOCTYPE html> <html> <body> <script> var dv = new … Read more

JavaScript DataView

In Javascript, a low-level interface for reading and writing multiple number types is facilitated with the help of DateView in an ArrayBuffer. JavaScript DataView Methods: getFloat32() Method: Use: To get a 32-bit float number at a specified location. getFloat64() Method: Use: To get a 64-bit float number at a specified location. getInt16() Method: Use: To … Read more

JavaScript Array unshift()

The JavaScript array unshift() method is used to add one or more elements at the starting index of the given array. Syntax: array.unshift (element1,element2,….) Parameters: element1,element2,… : The elements to be added in a given array. Returns: Original array with specific addition elements. Example: <!DOCTYPE html> <html> <body> <script> var a = [“GOLD”,”SILVER”,”DIAMOND”,”RUBY”,”PLATINUM”] var result=a.unshift(“BRONZE”); … Read more

JavaScript Array splice()

The JavaScript array splice() method is used to add/remove elements to/from the given array. Syntax: array.splice (start,delete,element1,element2,…) Parameters: start: It is a required parameter and represents the index from where the function starts to fetch the elements. delete: It is an optional parameter and represents the number of elements that have to be removed. element1,element2,… … Read more

JavaScript Array sort()

The JavaScript array sort() method is used to return the element of the given array in a sorted order. Syntax: array.sort(compareFunction) Parameters: compareFunction: It represents a function that provides the functionality of sort order. It is an optional parameter. Returns: An array with sorted elements. Example: <!DOCTYPE html> <html> <body> <script> var a = [“GOLD”,”SILVER”,”DIAMOND”,”RUBY”,”PLATINUM”] … Read more

JavaScript Array shift()

The JavaScript array shift() method is used to remove and return the first element of an array. Note: The length of the original array will be modified. Syntax: array. shift() Return: The first element of an array. Example: <!DOCTYPE html> <html> <body> <script> var a = [“GOLD”,”SILVER”,”DIAMOND”,”RUBY”,”PLATINUM”] var result=a.shift(); document.writeln(result + “<br>”); document.writeln(a); </script> </body> … Read more

JavaScript Array reverse()

The JavaScript array reverse() method is used to reverse the elements of the given array. Syntax: array.reverse() Return: Original array with elements in reverse order. Example: <!DOCTYPE html> <html> <body> <script> var a = [“GOLD”,”SILVER”,”DIAMOND”,”RUBY”,”PLATINUM”] var rev_a =a.reverse(); document.writeln(rev_a); </script> </body> </html>

JavaScript Array push()

The JavaScript array push() method is used to add one or more elements to the end of an array. Syntax: array.push (element1, element2….) Parameters: element1,element2… : Represents the elements to be added in an array. Returns: Original array with additional elements. Example: <!DOCTYPE html> <html> <head> </head> <body> <script> var a = [“GOLD”,”SILVER”,”DIAMOND”,”RUBY”,”PLATINUM”] a.push(“BRONZE”); document.writeln(a); … Read more