{"json_modified": "2016-04-04T12:31:16.901725", "uuid": "0328e2aa-1411-4e5b-bfa9-9eb94607965b", "title": "Atomics.compareExchange()", "url": "/en-US/docs/Web/JavaScript/Reference/Global_Objects/Atomics/compareExchange", "tags": ["Shared Memory", "Experimental", "Atomics", "Method", "JavaScript"], "translations": [{"uuid": "6e2c0e92-dacc-480d-8b89-d3033fc0245b", "title": "Atomics.compareExchange()", "url": "/fr/docs/Web/JavaScript/Reference/Objets_globaux/Atomics/compareExchange", "tags": ["M\u00e9moire partag\u00e9e", "M\u00e9thode", "Atomics", "Exp\u00e9rimental", "JavaScript"], "summary": "La m\u00e9thode statique Atomics.compareExchange() \u00e9change une valeur d'un tableau \u00e0 un emplacement donn\u00e9 si la valeur qui \u00e9tait dans le tableau correspond \u00e0 une valeur donn\u00e9e. Cette op\u00e9ration atomique garantit qu'aucune autre op\u00e9ration d'\u00e9criture n'est appliqu\u00e9e tant que la valeur modifi\u00e9e n'est pas \u00e9crite.", "localization_tags": [], "locale": "fr", "last_edit": "2016-01-30T08:15:48", "review_tags": []}], "modified": "2016-04-04T12:31:16", "label": "Atomics.compareExchange()", "localization_tags": [], "locale": "en-US", "id": 173499, "last_edit": "2016-01-28T11:35:48", "summary": "The static Atomics.compareExchange() method exchanges a given replacement value at a given position in the array, and returns the old value at that position, if a given expected value equals the old value. This atomic operation guarantees that no other write happens until the modified value is written back.", "sections": [{"id": "Quick_Links", "title": null}, {"id": "Syntax", "title": "Syntax"}, {"id": "Parameters", "title": "Parameters"}, {"id": "Return_value", "title": "Return value"}, {"id": "Exceptions", "title": "Exceptions"}, {"id": "Examples", "title": "Examples"}, {"id": "Specifications", "title": "Specifications"}, {"id": "Browser_compatibility", "title": "Browser compatibility"}, {"id": "See_also", "title": "See also"}], "slug": "Web/JavaScript/Reference/Global_Objects/Atomics/compareExchange", "review_tags": []}