JavaScript Atomics Reference Last Updated : 23 Jul, 2025 Comments Improve Suggest changes 4 Likes Like Report Atomics is an object in JavaScript that provides atomic operations to be performed as static methods Just like the Math object in JavaScript, all the properties and methods of Atomics are also static Atomics are used with SharedArrayBuffer (generic fixed-length binary data buffer) objects Atomics are not constructors like other global objects Atomics cannot be used with a new operator or can be invoked as a functionSyntax:Atomicsmethod(argument 1, argument 2, )Example: In this example load() function of the Atomic object returns the value at a given position of an array JavaScript // creating a SharedArrayBuffer let buf = new SharedArrayBuffer(25); let arr = new Uint8Array(buf); // Initialising element at the zeroth //position of an array with 9 arr[0] = 9; // Displaying the SharedArrayBuffer console.log(Atomics.load(arr, 0)); Output:9JavaScript Atomics Methods: The complete list of JavaScript Atomics methods are listed below MethodsDescriptionsadd( )Given the position in an array and return the old value at that positionand( )Compute a bitwise AND with a given value at a given position in the arraycompareExchange( ) It compares and exchanges a replacement valueexchange( )This is used to exchange and store a new value at a specific position in an arrayis lock-free( )Returns true if the given size is one of the BYTES_PER_ELEMENT properties of integerload( )Returns the value at the given position of the arraynotify()Notify some agents that are sleeping in the wait queueor( )Compute a bitwise OR operation with a given value at a given position in an arraystore( )Returns the value which was has been storedsub( )Returns the old value at that positionwait()Returns a string that is either “ok”, “not-equal”, or “timed-out”waitasync()Returns a promise without blocking the main threadxor( )Compute a bitwise XOR operation with a given value at a given position in an array Create Quiz Comment K kartik Follow 4 Improve K kartik Follow 4 Improve Article Tags : JavaScript Web Technologies JavaScript-atomics Explore JavaScript BasicsIntroduction to JavaScript4 min readVariables and Datatypes in JavaScript6 min readJavaScript Operators5 min readControl Statements in JavaScript4 min readArray & StringJavaScript Arrays7 min readJavaScript Array Methods7 min readJavaScript Strings5 min readJavaScript String Methods9 min readFunction & ObjectFunctions in JavaScript5 min readJavaScript Function Expression3 min readFunction Overloading in JavaScript4 min readObjects in JavaScript4 min readJavaScript Object Constructors4 min readOOPObject Oriented Programming in JavaScript3 min readClasses and Objects in JavaScript4 min readWhat Are Access Modifiers In JavaScript ?5 min readJavaScript Constructor Method7 min readAsynchronous JavaScriptAsynchronous JavaScript2 min readJavaScript Callbacks4 min readJavaScript Promise4 min readEvent Loop in JavaScript4 min readAsync and Await in JavaScript2 min readException HandlingJavascript Error and Exceptional Handling6 min readJavaScript Errors Throw and Try to Catch2 min readHow to create custom errors in JavaScript ?2 min readJavaScript TypeError - Invalid Array.prototype.sort argument1 min readDOMHTML DOM (Document Object Model)8 min readHow to select DOM Elements in JavaScript ?3 min readJavaScript Custom Events4 min readJavaScript addEventListener() with Examples9 min readAdvanced TopicsClosure in JavaScript4 min readJavaScript Hoisting6 min readScope of Variables in JavaScript3 min readJavaScript Higher Order Functions7 min readDebugging in JavaScript4 min read Like