- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Found 609 Articles for Front End Scripts
72 Views
The byteLength property of the DataView represents the length of the current Data View.SyntaxIts syntax is as followsdataView.byteLength();Example Live Demo JavaScript Example var arrayBuffer = new ArrayBuffer(8); var dataView = new DataView(arrayBuffer); document.write(dataView.byteLength); Output8
95 Views
The Atomic object of JavaScript is an object and which provides atomic operations such as add, sub, and, or, xor, load, store etc. as static methods, these methods are used with SharedArrayBuffer objects.The xor() function of the atomic object accepts a number and the position and, performs an xor operation on the given value at the given position.SyntaxIts syntax is as followsAtomics.xor()Example Live Demo JavaScript Example var arrayBuffer = new SharedArrayBuffer(16); var data = new Uint8Array(arrayBuffer); data[0] = 30; document.write(Atomics.xor(data, 0, 3)); document.write(", "+Atomics.load(data, 0)); Output30, 29
71 Views
The Atomic object of JavaScript is an object and which provides atomic operations such as add, sub, and, or, xor, load, store etc. as static methods, these methods are used with SharedArrayBuffer objects.The sub() function of the atomic object accepts a number and the position, subtracts the given number from the number in the given position and it returns the value of the number in the old position.SyntaxIts syntax is as follows.Atomics.sub()Example Live Demo JavaScript Example var arrayBuffer = new SharedArrayBuffer(16); var data = new Uint8Array(arrayBuffer); ... Read More
78 Views
The Atomic object of JavaScript is an object and which provides atomic operations such as add, sub, and, or, xor, load, store etc. as static methods, these methods are used with SharedArrayBuffer objects.The store() function of the atomic object accepts a number(value) and a position in the array and, stores the given value in the specified position and returns the same.SyntaxIts syntax is as followsAtomics.store()Example Live Demo JavaScript Example var arrayBuffer = new SharedArrayBuffer(16); var data = new Uint8Array(arrayBuffer); data[0] = 20; Atomics.store(data, ... Read More
81 Views
The Atomic object of JavaScript is an object and which provides atomic operations such as add, sub, and, or, xor, load, store etc. as static methods, these methods are used with SharedArrayBuffer objects.The load() function of the Atomic object returns the value at a given position of an array.SyntaxIts syntax is as followsAtomics.load()Example Live Demo JavaScript Example var arrayBuffer = new SharedArrayBuffer(16); var data = new Uint8Array(arrayBuffer); data[0] = 20; Atomics.add(data, 0, 30); document.write(Atomics.load(data, 0)); Output50Example Live Demo ... Read More
67 Views
The Atomic object of JavaScript is an object and which provides atomic operations such as add, sub, and, or, xor, load, store etc. as static methods, these methods are used with SharedArrayBuffer objects.This method is used to determine whether to use locks or atomic operations.SyntaxIts syntax is as followsAtomics.isLockFree(size)Example Live Demo JavaScript Example document.write(Atomics.isLockFree(7)); document.write(""); document.write(" "+Atomics.isLockFree(8)); Outputfalse false
65 Views
The Atomic object of JavaScript is an object and which provides atomic operations such as add, sub, and, or, xor, load, store etc. as static methods, these methods are used with SharedArrayBuffer objects.The or() function of the atomic object accepts a value representing the position of an array, performs bitwise OR operation on the value in the given position and returns the old value in it.SyntaxIts syntax is as followsAtomics.or(data, 0, 30)Example Live Demo JavaScript Example var arrayBuffer = new SharedArrayBuffer(16); var data = new Uint8Array(arrayBuffer); ... Read More
66 Views
The Atomic object of JavaScript is an object and which provides atomic operations such as add, sub, and, or, xor, load, store etc. as static methods, these methods are used with SharedArrayBuffer objects.The and() function of the Atomic object accepts a value representing the position of an array, performs bitwise AND operation on the value in the given position and returns the old value in it.SyntaxIts syntax is as followsAtomics.and()Example Live Demo JavaScript Example var arrayBuffer = new SharedArrayBuffer(16); var data = new Uint8Array(arrayBuffer); data[0] = ... Read More
82 Views
The Atomic object of JavaScript is an object and which provides atomic operations such as add, sub, and, or, xor, load, store etc. as static methods, these methods are used with SharedArrayBuffer objects.The add() function of this object accepts a number and the position, adds the given number to the number in the given position and returns the value of the number in the old position.SyntaxIts syntax is as followsAtomics.add()Example Live Demo JavaScript Example var arrayBuffer = new SharedArrayBuffer(16); var data = new Uint8Array(arrayBuffer); data[0] = ... Read More
376 Views
ArrayBuffer object in JavaScript represents a fixed-length binary data buffer.The slice() method of the this object returns a portion or, chunk from the array buffer (as a separate object). It accepts two integer arguments representing the start (inclusive) and end (exclusive) of the portion of the array to be returned.SyntaxIts syntax is as followsarrayBuffer.slice(start, end);ExampleTry the following example. Live Demo JavaScript Example var arrayBuffer = new ArrayBuffer(16); var int32View = new Int32Array(arrayBuffer); int32View[1] = 102; var sliced = new Int32Array(arrayBuffer.slice(4,12)); document.write(" "+sliced); Output102,0