file stringlengths 16 94 | text stringlengths 32 24.4k | vector list |
|---|---|---|
javascript/reference/global_objects/symbol/tostring/index.md | JavaScript - Global Objects - Symbol - toString:
The `toString()` method of `Symbol` values returns a string representing this symbol value.
Example:
console.log(Symbol("desc").toString());
// Expected output: "Symbol(desc)"
console.log(Symbol.iterator.toString());
// Expected output: "Symbol(Symbol.iterator)
cons... | [
-0.9280332326889038,
-0.05782340466976166,
-0.9401065111160278,
-0.2339162677526474,
-0.019813379272818565,
-2.423065423965454,
-0.23720180988311768,
0.46308761835098267,
0.08516416698694229,
-0.40108585357666016,
-0.08481716364622116,
0.8181858062744141,
0.4352738857269287,
0.118853434920... |
javascript/reference/global_objects/symbol/tostring/index.md | JavaScript - Global Objects - Symbol - toString - Syntax:
Example:
toString() | [
-0.8334185481071472,
0.43355947732925415,
-0.5770495533943176,
-0.24819453060626984,
-0.5078901648521423,
-2.662865161895752,
0.07687287032604218,
0.7857480645179749,
-0.32481086254119873,
-0.9727065563201904,
-0.3257572650909424,
0.5453132390975952,
-0.17543721199035645,
-0.38946768641471... |
javascript/reference/global_objects/symbol/tostring/index.md | JavaScript - Global Objects - Symbol - toString - Syntax - Parameters:
None. | [
-0.6503922343254089,
0.3170641362667084,
-0.8095964789390564,
-0.7596007585525513,
-0.5284607410430908,
-2.196049451828003,
0.5511060357093811,
0.9362876415252686,
-0.3234318792819977,
-0.9901199340820312,
-0.9096531867980957,
-0.23379682004451752,
0.0839613825082779,
-0.024926599115133286... |
javascript/reference/global_objects/symbol/tostring/index.md | JavaScript - Global Objects - Symbol - toString - Syntax - Return value:
A string representing the specified symbol value. | [
-0.5694332718849182,
0.06218588352203369,
-0.6565983891487122,
-0.3443649709224701,
-0.6862412095069885,
-2.5049736499786377,
0.3057374358177185,
1.1060177087783813,
-0.2123415768146515,
-0.24508967995643616,
-0.504997968673706,
1.0884360074996948,
-0.4272957444190979,
0.8584697842597961,
... |
javascript/reference/global_objects/symbol/tostring/index.md | JavaScript - Global Objects - Symbol - toString - Description:
The `Symbol` object overrides the `toString` method of `Object`; it does not inherit `Object.prototype.toString()`. For `Symbol` values, the `toString` method returns a descriptive string in the form `"Symbol(description)"`, where `description` is the symb... | [
-0.11129130423069,
0.3416275084018707,
-0.25791457295417786,
0.5358111262321472,
0.4796600937843323,
-1.5842678546905518,
0.577948272228241,
0.8516719341278076,
-0.6205505132675171,
0.2215941995382309,
-0.8338170647621155,
-0.2641106843948364,
0.05997050553560257,
0.20812837779521942,
1.... |
javascript/reference/global_objects/symbol/tostring/index.md | JavaScript - Global Objects - Symbol - toString - Examples - Using toString():
Example:
Symbol("desc").toString(); // "Symbol(desc)"
// well-known symbols
Symbol.iterator.toString(); // "Symbol(Symbol.iterator)"
// global symbols
Symbol.for("foo").toString(); // "Symbol(foo)" | [
-0.745285153388977,
0.37559694051742554,
-0.6169783473014832,
-0.2734962999820709,
-0.05431685969233513,
-2.8637144565582275,
-0.31106239557266235,
0.013667301274836063,
0.35343602299690247,
-0.28071328997612,
-0.4923749566078186,
0.5082399845123291,
0.007635352201759815,
-0.00669683143496... |
javascript/reference/global_objects/symbol/tostring/index.md | JavaScript - Global Objects - Symbol - toString - Examples - Implicitly calling toString():
The only way to make JavaScript implicitly call `toString()` instead of `[Symbol.toPrimitive]()` on a symbol wrapper object is by deleting the `[Symbol.toPrimitive]()` method first.
Warning: You should not do this in practice.... | [
-1.2375528812408447,
-0.0801774337887764,
0.3341802954673767,
0.7909289002418518,
-0.10955964773893356,
-2.653123378753662,
0.4660661816596985,
-0.19409015774726868,
-0.5062485933303833,
0.040557313710451126,
-0.9201813340187073,
-0.331218957901001,
-0.44745492935180664,
-0.663534462451934... |
javascript/reference/global_objects/symbol/dispose/index.md | JavaScript - Global Objects - Symbol - dispose:
The `Symbol.dispose` static data property represents the well-known symbol `Symbol.dispose`. The `using` declaration looks up this symbol on the variable initializer for the method to call when the variable goes out of scope. | [
-0.32020699977874756,
-0.2661455273628235,
-1.3182622194290161,
0.6113524436950684,
-0.37579408288002014,
-1.7674072980880737,
0.8453606963157654,
1.4582196474075317,
0.7197075486183167,
0.13710391521453857,
-0.5795391201972961,
0.30232149362564087,
0.5513449907302856,
0.5748311877250671,
... |
javascript/reference/global_objects/symbol/dispose/index.md | JavaScript - Global Objects - Symbol - dispose - Value:
The well-known symbol `Symbol.dispose`. | [
0.7240132093429565,
0.1839895397424698,
-1.1224337816238403,
-0.17475107312202454,
-0.6656201481819153,
-1.8271727561950684,
0.8794462084770203,
0.9399974346160889,
0.6039538383483887,
-0.40965762734413147,
-0.43922358751296997,
0.48304951190948486,
-0.5745535492897034,
0.7114623785018921,... |
javascript/reference/global_objects/symbol/dispose/index.md | JavaScript - Global Objects - Symbol - dispose - Description:
An object is disposable if it has the `[Symbol.dispose]()` method. The method is expected to have the following semantics:
- Invoking this method notifies the Disposable object that the caller does not intend to continue to use this object. This method sho... | [
0.1274242103099823,
-0.03573869913816452,
-0.8396211266517639,
0.326887845993042,
-0.5220007300376892,
-1.818564534187317,
0.9131073355674744,
0.8008493781089783,
-0.3674411177635193,
0.062378816306591034,
-0.6343322992324829,
0.8908295035362244,
-0.01381212379783392,
0.3842447102069855,
... |
javascript/reference/global_objects/symbol/dispose/index.md | JavaScript - Global Objects - Symbol - dispose - Examples - User defined disposables:
`[Symbol.dispose]` allows the creation of custom disposables. See the `using` reference for more information.
Example:
class Disposable {
constructor() {
this.disposed = false;
}
[Symbol.dispose]() {
this.disposed = ... | [
0.048833124339580536,
-0.4571838676929474,
-0.9494696855545044,
0.4615035355091095,
-0.47475364804267883,
-1.776688575744629,
0.8431186676025391,
1.1197915077209473,
0.20928962528705597,
0.2063961923122406,
-0.19826459884643555,
0.5445472598075867,
-0.06067223101854324,
-0.2968674600124359... |
javascript/reference/global_objects/symbol/for/index.md | JavaScript - Global Objects - Symbol - for:
The `Symbol.for()` static method searches for existing symbols in a runtime-wide symbol registry with the given key and returns it if found. Otherwise a new symbol gets created in the global symbol registry with this key.
Example:
console.log(Symbol.for("bar") === Symbol.f... | [
-0.6977304816246033,
-0.27170637249946594,
-1.2026571035385132,
0.32566872239112854,
0.026120400056242943,
-2.440659284591675,
0.044154953211545944,
1.1805692911148071,
0.3275899291038513,
0.2688908576965332,
-0.11593353748321533,
0.4826432168483734,
0.3558192849159241,
0.6882586479187012,... |
javascript/reference/global_objects/symbol/for/index.md | JavaScript - Global Objects - Symbol - for - Syntax:
Example:
Symbol.for(key) | [
-0.12456392496824265,
0.1816033273935318,
-0.7973313927650452,
-0.4609675407409668,
-0.6655870079994202,
-2.9108712673187256,
0.2546468675136566,
1.7448166608810425,
-0.019051991403102875,
-0.549068808555603,
0.07841715216636658,
0.9160423874855042,
-0.13537178933620453,
0.5014207363128662... |
javascript/reference/global_objects/symbol/for/index.md | JavaScript - Global Objects - Symbol - for - Syntax - Parameters:
- `key`: String, required. The key for the symbol (and also used for the description of the symbol). | [
-0.1337965726852417,
-0.017354223877191544,
-1.1893739700317383,
-0.47794029116630554,
-0.26528871059417725,
-2.782228946685791,
0.008787956088781357,
1.0588401556015015,
0.026129232719540596,
-0.38655152916908264,
-0.4735110402107239,
0.3932609260082245,
-0.13656826317310333,
1.0082688331... |
javascript/reference/global_objects/symbol/for/index.md | JavaScript - Global Objects - Symbol - for - Syntax - Return value:
An existing symbol with the given key if found; otherwise, a new symbol is created and returned. | [
-0.1181672215461731,
0.08042686432600021,
-0.7642565965652466,
0.0586133636534214,
-0.6273388862609863,
-2.1109654903411865,
0.37227481603622437,
1.7076231241226196,
-0.2659214735031128,
0.053889114409685135,
-0.15200752019882202,
0.8407062888145447,
-0.15839071571826935,
1.356480002403259... |
javascript/reference/global_objects/symbol/for/index.md | JavaScript - Global Objects - Symbol - for - Description:
In contrast to `Symbol()`, the `Symbol.for()` function creates a symbol available in a global symbol registry list. `Symbol.for()` does also not necessarily create a new symbol on every call, but checks first if a symbol with the given `key` is already present ... | [
-1.0126900672912598,
-0.2878071665763855,
-0.4792441427707672,
0.41517940163612366,
-0.09788179397583008,
-2.3493947982788086,
0.05553716421127319,
1.3871898651123047,
0.1930568665266037,
0.12178857624530792,
0.24370311200618744,
0.5735703706741333,
0.5039388537406921,
0.6909274458885193,
... |
javascript/reference/global_objects/symbol/for/index.md | JavaScript - Global Objects - Symbol - for - Examples - Using Symbol.for():
Example:
Symbol.for("foo"); // create a new global symbol
Symbol.for("foo"); // retrieve the already created symbol
// Same global symbol, but not locally
Symbol.for("bar") === Symbol.for("bar"); // true
Symbol("bar") === Symbol("bar"); // f... | [
0.2068016678094864,
0.035682715475559235,
-1.2120188474655151,
-0.01008080504834652,
-0.3602100610733032,
-2.8382115364074707,
0.17735427618026733,
0.9683142900466919,
-0.10194550454616547,
0.2103872299194336,
-0.28390687704086304,
1.0125483274459839,
-0.02067183144390583,
0.05913434550166... |
javascript/reference/global_objects/symbol/unscopables/index.md | JavaScript - Global Objects - Symbol - unscopables:
The `Symbol.unscopables` static data property represents the well-known symbol `Symbol.unscopables`. The `with` statement looks up this symbol on the scope object for a property containing a collection of properties that should not become bindings within the `with` e... | [
-1.0647059679031372,
-0.24849539995193481,
-1.0738096237182617,
-0.026110896840691566,
-0.3212617337703705,
-1.8212581872940063,
0.40830832719802856,
0.7113144397735596,
0.5372647643089294,
0.40056490898132324,
-0.2667751908302307,
0.8284847736358643,
0.702347993850708,
-0.3837026357650757... |
javascript/reference/global_objects/symbol/unscopables/index.md | JavaScript - Global Objects - Symbol - unscopables - Value:
The well-known symbol `Symbol.unscopables`. | [
0.01797281578183174,
0.7373861074447632,
-0.8597111701965332,
-0.5667058229446411,
-0.8301898241043091,
-1.7384132146835327,
0.824028491973877,
0.6528223752975464,
0.290055513381958,
-0.15558241307735443,
-0.7336298823356628,
0.48872995376586914,
0.35877177119255066,
0.07695814222097397,
... |
javascript/reference/global_objects/symbol/unscopables/index.md | JavaScript - Global Objects - Symbol - unscopables - Description:
The `[Symbol.unscopables]` symbol (accessed via `Symbol.unscopables`) can be defined on any object to exclude property names from being exposed as lexical variables in `with` environment bindings. Note that when using strict mode, `with` statements are ... | [
-0.45844584703445435,
0.15539893507957458,
0.07442393898963928,
0.5349491834640503,
0.4091636836528778,
-0.33565035462379456,
0.5179708003997803,
0.5598541498184204,
0.030779853463172913,
-0.35790395736694336,
-0.6747397780418396,
0.16526862978935242,
0.05926867201924324,
-0.06290153414011... |
javascript/reference/global_objects/symbol/unscopables/index.md | JavaScript - Global Objects - Symbol - unscopables - Examples - Scoping in with statements:
The following code works fine in ES5 and below. However, in ECMAScript 2015, the `Array.prototype.values()` method was introduced. That means that inside a `with` environment, "values" would now be the `Array.prototype.values()... | [
-0.5072128176689148,
0.3007059097290039,
-0.029734883457422256,
0.48934808373451233,
0.9561213254928589,
-0.8698738813400269,
0.3333851993083954,
0.8119928240776062,
-0.35056355595588684,
0.3791143000125885,
-0.0735539048910141,
0.2814326286315918,
0.28727567195892334,
-0.17991945147514343... |
javascript/reference/global_objects/symbol/unscopables/index.md | JavaScript - Global Objects - Symbol - unscopables - Examples - Unscopables in objects:
You can also set `[Symbol.unscopables]` for your own objects.
Example:
const obj = {
foo: 1,
bar: 2,
baz: 3,
};
obj[Symbol.unscopables] = {
// Make the object have `null` prototype to prevent
// `Object.prototype` meth... | [
-0.2883155643939972,
0.4076705873012543,
-1.2530983686447144,
0.30345267057418823,
-0.006898955907672644,
-1.8646483421325684,
0.5611685514450073,
0.19971521198749542,
-0.06012304499745369,
0.7415281534194946,
-0.7971258759498596,
0.3832332193851471,
0.4427393972873688,
-0.5419201850891113... |
javascript/reference/global_objects/symbol/unscopables/index.md | JavaScript - Global Objects - Symbol - unscopables - Examples - Avoid using a non-null-prototype object as `[Symbol.unscopables]`:
Declaring `[Symbol.unscopables]` as a plain object without eliminating its prototype may cause subtle bugs. Consider the following code working before `[Symbol.unscopables]`:
Example:
co... | [
-0.22476418316364288,
0.4149131178855896,
-0.5793524980545044,
0.08600065857172012,
0.3895072340965271,
-0.425766259431839,
-0.5702784657478333,
0.5298000574111938,
-0.16807639598846436,
0.1650865525007248,
-0.6334848403930664,
0.23326538503170013,
-0.24160189926624298,
0.13299596309661865... |
javascript/reference/global_objects/symbol/description/index.md | JavaScript - Global Objects - Symbol - description:
The `description` accessor property of `Symbol` values returns a string containing the description of this symbol, or `undefined` if the symbol has no description.
Example:
console.log(Symbol("desc").description);
// Expected output: "desc"
console.log(Symbol.iter... | [
-1.3259552717208862,
-0.9735349416732788,
-1.116910696029663,
0.148545503616333,
-0.5639784932136536,
-1.646835446357727,
0.6722903847694397,
0.6419626474380493,
0.3060252070426941,
0.10806045681238174,
-0.5793856978416443,
0.16542817652225494,
0.368252694606781,
0.3783254623413086,
-0.2... |
javascript/reference/global_objects/symbol/description/index.md | JavaScript - Global Objects - Symbol - description - Description:
`Symbol` objects can be created with an optional description which can be used for debugging but not to access the symbol itself. The `Symbol.prototype.description` property can be used to read that description. It is different to `Symbol.prototype.toSt... | [
-0.7217516303062439,
-0.4956556558609009,
-0.3590549826622009,
-0.02180427685379982,
-0.10221146792173386,
-2.7328734397888184,
0.09127509593963623,
0.2016085833311081,
0.3601180613040924,
-0.05522845312952995,
-1.081408143043518,
0.3451181948184967,
0.5477681159973145,
-0.0607191585004329... |
javascript/reference/global_objects/symbol/description/index.md | JavaScript - Global Objects - Symbol - description - Examples - Using description:
Example:
Symbol("desc").toString(); // "Symbol(desc)"
Symbol("desc").description; // "desc"
Symbol("").description; // ""
Symbol().description; // undefined
// well-known symbols
Symbol.iterator.toString(); // "Symbol(Symbol.iterator)... | [
-0.46301448345184326,
0.02262660302221775,
-0.8306837677955627,
-0.4896872937679291,
-0.18725374341011047,
-2.667532205581665,
-0.05198834463953972,
0.35124877095222473,
0.4359314441680908,
0.047499872744083405,
-0.680026113986969,
0.44990572333335876,
-0.08611135929822922,
0.2244870513677... |
javascript/reference/global_objects/symbol/keyfor/index.md | JavaScript - Global Objects - Symbol - keyFor:
The `Symbol.keyFor()` static method retrieves a shared symbol key from the global symbol registry for the given symbol.
Example:
const globalSym = Symbol.for("foo"); // Global symbol
console.log(Symbol.keyFor(globalSym));
// Expected output: "foo"
const localSym = Sym... | [
-0.7448278069496155,
-0.15830649435520172,
-1.21311354637146,
-0.210154727101326,
-0.4897157549858093,
-2.1775145530700684,
0.10389444977045059,
0.7019409537315369,
-0.09696608781814575,
0.683048665523529,
-0.019619813188910484,
0.8966146111488342,
0.26242193579673767,
0.6141020059585571,
... |
javascript/reference/global_objects/symbol/keyfor/index.md | JavaScript - Global Objects - Symbol - keyFor - Syntax:
Example:
Symbol.keyFor(sym) | [
-0.5027385950088501,
0.37369075417518616,
-0.46713823080062866,
-0.4825708866119385,
-1.028531551361084,
-2.657987594604492,
0.3458411693572998,
1.4014580249786377,
0.11130276322364807,
-0.0720362737774849,
0.312965989112854,
1.221551775932312,
0.17140690982341766,
0.535330593585968,
0.7... |
javascript/reference/global_objects/symbol/keyfor/index.md | JavaScript - Global Objects - Symbol - keyFor - Syntax - Parameters:
- `sym`: Symbol, required. The symbol to find a key for. | [
-0.10069485008716583,
0.1077459380030632,
-0.8735437393188477,
-0.6453937888145447,
-0.7057383060455322,
-2.2384815216064453,
0.18960346281528473,
1.0807361602783203,
0.33377715945243835,
0.19459787011146545,
-0.0468948669731617,
0.8605595231056213,
-0.3487561047077179,
1.121933102607727,
... |
javascript/reference/global_objects/symbol/keyfor/index.md | JavaScript - Global Objects - Symbol - keyFor - Syntax - Return value:
A string representing the key for the given symbol if one is found on the global registry; otherwise, `undefined`. | [
-0.6021302342414856,
0.049533504992723465,
-0.7323741316795349,
-0.12563848495483398,
-0.7194929122924805,
-2.221888303756714,
0.673651397228241,
0.8770318031311035,
0.02636893279850483,
0.49271059036254883,
0.14274045825004578,
1.2143986225128174,
-0.053196489810943604,
1.2344951629638672... |
javascript/reference/global_objects/symbol/keyfor/index.md | JavaScript - Global Objects - Symbol - keyFor - Examples - Using keyFor():
Example:
const globalSym = Symbol.for("foo"); // create a new global symbol
Symbol.keyFor(globalSym); // "foo"
const localSym = Symbol();
Symbol.keyFor(localSym); // undefined
// well-known symbols are not symbols registered
// in the global... | [
-0.533867359161377,
0.45458295941352844,
-0.6540998220443726,
0.5020542144775391,
-0.3583793342113495,
-2.2686243057250977,
-0.08279260247945786,
0.8933542370796204,
0.09456504136323929,
0.33958888053894043,
-0.19138523936271667,
0.7695556282997131,
0.40611931681632996,
-0.0360660515725612... |
javascript/reference/global_objects/symbol/iterator/index.md | JavaScript - Global Objects - Symbol - iterator:
The `Symbol.iterator` static data property represents the well-known symbol `Symbol.iterator`. The iterable protocol looks up this symbol for the method that returns the iterator for an object. In order for an object to be iterable, it must have a `[Symbol.iterator]` ke... | [
-0.5459004640579224,
0.1755140721797943,
-0.6017134785652161,
0.3534555733203888,
0.37289127707481384,
-1.8152692317962646,
-0.7983719110488892,
1.6904523372650146,
-0.36872851848602295,
0.5043542981147766,
-0.42133477330207825,
0.7005560994148254,
-0.27739089727401733,
0.4994651973247528,... |
javascript/reference/global_objects/symbol/iterator/index.md | JavaScript - Global Objects - Symbol - iterator - Value:
The well-known symbol `Symbol.iterator`. | [
0.17490090429782867,
0.37430351972579956,
-0.7032076120376587,
-0.18573734164237976,
-0.4056367576122284,
-2.125154495239258,
-0.16499702632427216,
1.2916022539138794,
-0.37026235461235046,
-0.2960667014122009,
-0.5675530433654785,
0.23471222817897797,
-0.4453900456428528,
0.48775807023048... |
javascript/reference/global_objects/symbol/iterator/index.md | JavaScript - Global Objects - Symbol - iterator - Description:
Whenever an object needs to be iterated (such as at the beginning of a `for...of` loop), its `[Symbol.iterator]()` method is called with no arguments, and the returned iterator is used to obtain the values to be iterated.
Some built-in types have a defaul... | [
-0.6839272975921631,
-0.18941587209701538,
-0.6945765018463135,
0.31399470567703247,
-0.1156393364071846,
-1.1945050954818726,
-0.1698707789182663,
1.3262131214141846,
-0.547625720500946,
0.30684271454811096,
-0.2879352271556854,
0.23081286251544952,
-0.10207977145910263,
0.472963124513626... |
javascript/reference/global_objects/symbol/iterator/index.md | JavaScript - Global Objects - Symbol - iterator - Examples - User-defined iterables:
We can make our own iterables like this:
Example:
const myIterable = {};
myIterable[Symbol.iterator] = function* () {
yield 1;
yield 2;
yield 3;
};
[...myIterable]; // [1, 2, 3]
Or iterables can be defined directly inside a c... | [
-0.26422029733657837,
0.2672455310821533,
-0.9196589589118958,
0.19181916117668152,
0.2276836782693863,
-1.480822205543518,
-0.5359981060028076,
1.3831645250320435,
-0.3156893253326416,
0.07448096573352814,
-0.23901653289794922,
0.46712011098861694,
-1.0411245822906494,
-0.1548253744840622... |
javascript/reference/global_objects/symbol/iterator/index.md | JavaScript - Global Objects - Symbol - iterator - Examples - Non-well-formed iterables:
If an iterable's `[Symbol.iterator]()` method does not return an iterator object, then it is a non-well-formed iterable. Using it as such is likely to result in runtime exceptions or buggy behavior:
Example:
const nonWellFormedIt... | [
-0.07805022597312927,
0.708095133304596,
-0.7301385402679443,
-0.03422654792666435,
-0.43950340151786804,
-1.4869943857192993,
-0.2140364795923233,
1.5290123224258423,
-1.5481059551239014,
0.21324975788593292,
-0.2731805741786957,
0.17349816858768463,
-0.062248967587947845,
-0.470880270004... |
javascript/reference/global_objects/symbol/valueof/index.md | JavaScript - Global Objects - Symbol - valueOf:
The `valueOf()` method of `Symbol` values returns this symbol value.
Example:
const symbol = Symbol("foo");
console.log(typeof Object(symbol));
// Expected output: "object"
console.log(typeof Object(symbol).valueOf());
// Expected output: "symbol" | [
-0.1828680783510208,
-0.2843502461910248,
-0.9449156522750854,
-0.07114449888467789,
-0.30621299147605896,
-1.5192389488220215,
-0.13008467853069305,
1.0549248456954956,
0.1342857927083969,
-0.3623788356781006,
-0.504468560218811,
0.9879342913627625,
0.6366310119628906,
0.25638988614082336... |
javascript/reference/global_objects/symbol/valueof/index.md | JavaScript - Global Objects - Symbol - valueOf - Syntax:
Example:
valueOf() | [
0.3348177671432495,
-0.0005473538767546415,
-0.6811439990997314,
-0.2556956112384796,
-0.47241753339767456,
-1.9051450490951538,
0.6993714570999146,
1.453437089920044,
0.371307373046875,
-0.8454563617706299,
-0.5607472658157349,
0.8160181045532227,
-0.24142059683799744,
0.2771400511264801,... |
javascript/reference/global_objects/symbol/valueof/index.md | JavaScript - Global Objects - Symbol - valueOf - Syntax - Parameters:
None. | [
0.132750004529953,
0.3295907974243164,
-1.1091411113739014,
-0.5415866374969482,
-0.6285529136657715,
-1.5064003467559814,
0.9478858113288879,
1.3876246213912964,
0.0010045452509075403,
-0.9298730492591858,
-0.8621207475662231,
-0.001914516557008028,
-0.0980188250541687,
0.2215224653482437... |
javascript/reference/global_objects/symbol/valueof/index.md | JavaScript - Global Objects - Symbol - valueOf - Syntax - Return value:
The primitive value of the specified `Symbol` object. | [
-0.051891084760427475,
0.2853738069534302,
-0.5178552865982056,
-0.5891042947769165,
-0.6702147126197815,
-1.4638794660568237,
1.2455955743789673,
1.4496309757232666,
0.12876471877098083,
-0.28882265090942383,
-0.9078940749168396,
0.9554300904273987,
-0.7323724627494812,
1.0013587474822998... |
javascript/reference/global_objects/symbol/valueof/index.md | JavaScript - Global Objects - Symbol - valueOf - Description:
The `valueOf()` method of `Symbol` returns the primitive value of a Symbol object as a Symbol data type.
JavaScript calls the `valueOf()` method to convert an object to a primitive value. You rarely need to invoke the `valueOf()` method yourself; JavaScrip... | [
-0.5120231509208679,
-0.2106044888496399,
-0.6524214148521423,
0.2442537099123001,
-0.2029939889907837,
-1.513710856437683,
1.706074833869934,
0.9191510081291199,
-0.25923001766204834,
-0.2600955069065094,
-0.7888403534889221,
0.5837149620056152,
-0.15916121006011963,
0.39344969391822815,
... |
javascript/reference/global_objects/symbol/valueof/index.md | JavaScript - Global Objects - Symbol - valueOf - Examples - Using valueOf():
Example:
const sym = Symbol("example");
sym === sym.valueOf(); // true | [
-0.07075076550245285,
-0.41762784123420715,
-0.27872219681739807,
0.2261362373828888,
-0.563689112663269,
-1.637028694152832,
0.48451998829841614,
0.785938560962677,
0.6178901195526123,
-0.28367140889167786,
-0.5836893916130066,
1.0560288429260254,
-0.08370911329984665,
0.03995073586702347... |
javascript/reference/global_objects/symbol/search/index.md | JavaScript - Global Objects - Symbol - search:
The `Symbol.search` static data property represents the well-known symbol `Symbol.search`. The `String.prototype.search()` method looks up this symbol on its first argument for the method that returns the index within a string that matches the current object.
For more in... | [
-1.3089661598205566,
-0.40727636218070984,
-0.8137804269790649,
-0.2811795771121979,
0.06834139674901962,
-1.6364482641220093,
0.1385640949010849,
1.1911678314208984,
0.3450833857059479,
-0.2597498297691345,
-0.9890731573104858,
0.6762090921401978,
0.490214079618454,
-0.06818417459726334,
... |
javascript/reference/global_objects/symbol/search/index.md | JavaScript - Global Objects - Symbol - search - Value:
The well-known symbol `Symbol.search`. | [
-0.1786571741104126,
0.26731833815574646,
-1.0902351140975952,
-0.673285722732544,
-0.6928467750549316,
-1.7401119470596313,
0.7013605833053589,
0.941432774066925,
-0.08212928473949432,
-0.8605110049247742,
-0.6421507596969604,
-0.0699082687497139,
-0.06866451352834702,
0.4654048979282379,... |
javascript/reference/global_objects/symbol/search/index.md | JavaScript - Global Objects - Symbol - search - Examples - Custom string search:
Example:
class CaseInsensitiveSearch {
constructor(value) {
this.value = value.toLowerCase();
}
[Symbol.search](string) {
return string.toLowerCase().indexOf(this.value);
}
}
console.log("foobar".search(new CaseInsensiti... | [
-0.8027300834655762,
0.02804795652627945,
0.04055722430348396,
0.6871024370193481,
0.23256650567054749,
-1.7739349603652954,
0.6940168738365173,
1.0180608034133911,
-0.648435115814209,
0.11940427124500275,
-0.6348264217376709,
0.41286706924438477,
0.0779934972524643,
-0.289628267288208,
... |
javascript/reference/global_objects/symbol/species/index.md | JavaScript - Global Objects - Symbol - species:
The `Symbol.species` static data property represents the well-known symbol `Symbol.species`. Methods that create copies of an object may look up this symbol on the object for the constructor function to use when creating the copy.
Warning: The existence of `[Symbol.spec... | [
-0.8865535855293274,
-0.5621849894523621,
-1.326692819595337,
0.3518911898136139,
-0.036265142261981964,
-2.3313310146331787,
0.6082378625869751,
1.5983401536941528,
0.1513703465461731,
0.15789435803890228,
-1.1311358213424683,
0.7248985171318054,
-0.0317888967692852,
0.10182138532400131,
... |
javascript/reference/global_objects/symbol/species/index.md | JavaScript - Global Objects - Symbol - species - Value:
The well-known symbol `Symbol.species`. | [
-0.24362991750240326,
0.13704313337802887,
-1.2491278648376465,
-0.559577226638794,
-1.0954571962356567,
-2.575376033782959,
0.8360978364944458,
0.8069680333137512,
-0.43395373225212097,
-0.5803146362304688,
-0.7974397540092468,
0.7450631260871887,
-0.5231643319129944,
0.6239782571792603,
... |
javascript/reference/global_objects/symbol/species/index.md | JavaScript - Global Objects - Symbol - species - Description:
The `[Symbol.species]` accessor property allows subclasses to override the default constructor for objects. This specifies a protocol about how instances should be copied. For example, when you use copying methods of arrays, such as `map()`, the `map()` met... | [
-1.0788013935089111,
-0.947676956653595,
-1.1121826171875,
0.9659003019332886,
-0.058842699974775314,
-1.8138545751571655,
0.7469083666801453,
0.904381513595581,
-0.0867343619465828,
-0.09751994907855988,
-0.9673877954483032,
0.5193203091621399,
-0.3412104845046997,
0.3591785430908203,
0... |
javascript/reference/global_objects/symbol/species/index.md | JavaScript - Global Objects - Symbol - species - Examples - Using species:
You might want to return `Array` objects in your derived array class `MyArray`. For example, when using methods such as `map()` that return the default constructor, you want these methods to return a parent `Array` object, instead of the `MyArr... | [
-0.5707332491874695,
-0.5128364562988281,
-1.3617700338363647,
0.7899709939956665,
-0.5452135801315308,
-2.3972983360290527,
0.20413373410701752,
0.8811625242233276,
-0.7013078927993774,
0.4012633264064789,
-0.3318829834461212,
0.9317402243614197,
-0.8030588030815125,
-0.06055222451686859,... |
javascript/reference/global_objects/symbol/match/index.md | JavaScript - Global Objects - Symbol - match:
The `Symbol.match` static data property represents the well-known symbol `Symbol.match`. The `String.prototype.match()` method looks up this symbol on its first argument for the method used to match an input string against the current object. This symbol is also used to de... | [
-0.24257349967956543,
0.19807158410549164,
-0.39992016553878784,
0.619703471660614,
0.3767528831958771,
-0.7377665638923645,
-0.40461117029190063,
0.5162445306777954,
-0.1270820051431656,
-0.3622439503669739,
-0.6735633015632629,
-0.040404852479696274,
0.4564644694328308,
0.235777080059051... |
javascript/reference/global_objects/symbol/match/index.md | JavaScript - Global Objects - Symbol - match - Value:
The well-known symbol `Symbol.match`. | [
0.6465124487876892,
0.19083449244499207,
-1.2958747148513794,
-0.5688738822937012,
-0.5744498372077942,
-2.138612747192383,
1.153820276260376,
0.796118438243866,
-0.15585729479789734,
-0.6375323534011841,
-1.0026503801345825,
-0.11733638495206833,
0.09377671033143997,
0.7008594870567322,
... |
javascript/reference/global_objects/symbol/match/index.md | JavaScript - Global Objects - Symbol - match - Description:
This function is also used to identify if objects have the behavior of regular expressions. For example, the methods `String.prototype.startsWith()`, `String.prototype.endsWith()` and `String.prototype.includes()`, check if their first argument is a regular e... | [
-0.5006019473075867,
-0.684529721736908,
-0.8125612735748291,
0.4069943428039551,
-0.3611355125904083,
-1.0999451875686646,
0.7684233784675598,
0.6484916806221008,
0.11608938127756119,
0.04155093431472778,
-1.430382490158081,
-0.5982435345649719,
0.517085075378418,
-0.06471636146306992,
... |
javascript/reference/global_objects/symbol/match/index.md | JavaScript - Global Objects - Symbol - match - Examples - Marking a RegExp as not a regex:
The following code will throw a `TypeError`:
Example:
"/bar/".startsWith(/bar/);
// Throws TypeError, as /bar/ is a regular expression
// and Symbol.match is not modified.
However, if you set `Symbol.match` to `false`, the o... | [
0.5045082569122314,
0.3841480612754822,
-0.3438286781311035,
0.13390180468559265,
-0.3712352216243744,
-0.7094300389289856,
0.42218533158302307,
1.4817943572998047,
0.36256006360054016,
-0.3496844470500946,
-0.5315735340118408,
-0.16525502502918243,
0.4223530888557434,
-0.11800166219472885... |
javascript/reference/global_objects/symbol/asyncdispose/index.md | JavaScript - Global Objects - Symbol - asyncDispose:
The `Symbol.asyncDispose` static data property represents the well-known symbol `Symbol.asyncDispose`. The `await using` declaration looks up this symbol on the variable initializer for the method to call when the variable goes out of scope. | [
-0.5743616223335266,
-0.0934489294886589,
-0.9735515117645264,
0.8008092045783997,
-0.662893533706665,
-2.017979383468628,
0.6561545729637146,
1.909724473953247,
0.6459009051322937,
0.582073450088501,
-0.7927494049072266,
0.1167682409286499,
0.8438993096351624,
0.5152717232704163,
0.7108... |
javascript/reference/global_objects/symbol/asyncdispose/index.md | JavaScript - Global Objects - Symbol - asyncDispose - Value:
The well-known symbol `Symbol.asyncDispose`. | [
0.47088655829429626,
0.21844148635864258,
-0.8830916285514832,
-0.21920587122440338,
-1.199845790863037,
-1.900061845779419,
1.0658050775527954,
1.2609816789627075,
0.9236208200454712,
0.03128429502248764,
-0.5564048290252686,
0.04180166497826576,
0.2440369427204132,
0.6369706392288208,
... |
javascript/reference/global_objects/symbol/asyncdispose/index.md | JavaScript - Global Objects - Symbol - asyncDispose - Description:
An object is async disposable if it has the `[Symbol.asyncDispose]()` method. The method is expected to have the following semantics:
- Invoking this method notifies the AsyncDisposable object that the caller does not intend to continue to use this ob... | [
0.026228414848446846,
0.11989549547433853,
-0.7775698900222778,
0.4020712375640869,
-0.441952109336853,
-2.241696834564209,
0.7306557893753052,
0.7471151351928711,
-0.16524375975131989,
0.3352079391479492,
-0.47808754444122314,
0.3454837203025818,
-0.10525522381067276,
0.43900471925735474,... |
javascript/reference/global_objects/symbol/asyncdispose/index.md | JavaScript - Global Objects - Symbol - asyncDispose - Examples - User defined async disposables:
`[Symbol.asyncDispose]` allows the creation of custom async disposables. See the `await using` reference for more information.
Example:
class Disposable {
#fileHandle;
#disposed;
constructor(handle) {
this.#di... | [
0.11601080745458603,
-0.20807206630706787,
-0.926125705242157,
0.6959059238433838,
-0.3372901976108551,
-1.602353572845459,
0.492896169424057,
1.5113565921783447,
0.2992602586746216,
0.29422861337661743,
-0.4535049498081207,
0.27903488278388977,
0.13069333136081696,
-0.023538019508123398,
... |
javascript/reference/global_objects/symbol/asynciterator/index.md | JavaScript - Global Objects - Symbol - asyncIterator:
The `Symbol.asyncIterator` static data property represents the well-known symbol `Symbol.asyncIterator`. The async iterable protocol looks up this symbol for the method that returns the async iterator for an object. In order for an object to be async iterable, it m... | [
-0.5407989025115967,
-0.038564283400774,
-0.2479131668806076,
0.050824955105781555,
-0.14546708762645721,
-1.4757225513458252,
-0.6978085041046143,
1.399948239326477,
-0.20582687854766846,
0.7086223363876343,
-0.48058584332466125,
0.6484904289245605,
-0.13401161134243011,
0.753221392631530... |
javascript/reference/global_objects/symbol/asynciterator/index.md | JavaScript - Global Objects - Symbol - asyncIterator - Value:
The well-known symbol `Symbol.asyncIterator`. | [
-0.3340998888015747,
0.5653203725814819,
-0.7395018935203552,
-0.10370852053165436,
-0.5855579972267151,
-2.4317691326141357,
-0.06730000674724579,
1.5937105417251587,
0.07903900742530823,
0.17453952133655548,
-0.48712119460105896,
-0.010846049524843693,
-0.15065960586071014,
0.53153580427... |
javascript/reference/global_objects/symbol/asynciterator/index.md | JavaScript - Global Objects - Symbol - asyncIterator - Examples - User-defined async iterables:
You can define your own async iterable by setting the `[Symbol.asyncIterator]()` property on an object.
Example:
const myAsyncIterable = {
async *[Symbol.asyncIterator]() {
yield "hello";
yield "async";
yiel... | [
-0.4267236292362213,
0.07841519266366959,
-0.7172684669494629,
0.9773470759391785,
-0.2033456414937973,
-1.5008124113082886,
-0.6002330183982849,
1.2422235012054443,
-0.03948265686631203,
0.5780177116394043,
-0.036365460604429245,
0.4597620964050293,
-0.27726224064826965,
-0.02636744640767... |
javascript/reference/global_objects/symbol/asynciterator/index.md | JavaScript - Global Objects - Symbol - asyncIterator - Examples - Built-in async iterables:
There is no object in the core JavaScript language that is async iterable. Some web APIs, such as `ReadableStream`, have the `Symbol.asyncIterator` method set by default. | [
-0.5314404368400574,
0.571658730506897,
-0.5357136130332947,
0.5107218027114868,
-0.21638049185276031,
-1.5140550136566162,
-0.49789905548095703,
1.2723388671875,
-0.6612733006477356,
-0.14767393469810486,
-0.08428801596164703,
-0.5902076363563538,
-0.3404204547405243,
0.11700794845819473,... |
javascript/reference/global_objects/symbol/isconcatspreadable/index.md | JavaScript - Global Objects - Symbol - isConcatSpreadable:
The `Symbol.isConcatSpreadable` static data property represents the well-known symbol `Symbol.isConcatSpreadable`. The `Array.prototype.concat()` method looks up this symbol on each object being concatenated to determine if it should be treated as an array-lik... | [
-0.133488267660141,
-0.41936230659484863,
-1.4246915578842163,
0.30232080817222595,
-0.027746932581067085,
-2.2717864513397217,
0.024048421531915665,
0.9649447202682495,
0.7224127650260925,
0.6121414303779602,
-0.8751221299171448,
0.8635523319244385,
0.05752027779817581,
-0.121379360556602... |
javascript/reference/global_objects/symbol/isconcatspreadable/index.md | JavaScript - Global Objects - Symbol - isConcatSpreadable - Value:
The well-known symbol `Symbol.isConcatSpreadable`. | [
-0.1865895837545395,
0.29090675711631775,
-0.7741943001747131,
-0.2636493742465973,
-0.9207345843315125,
-2.0041568279266357,
0.11255288124084473,
0.7301817536354065,
0.5912315845489502,
-0.17439134418964386,
-1.0802769660949707,
0.713196873664856,
0.20994925498962402,
0.003066839650273323... |
javascript/reference/global_objects/symbol/isconcatspreadable/index.md | JavaScript - Global Objects - Symbol - isConcatSpreadable - Description:
The `[Symbol.isConcatSpreadable]` property can be defined as an own or inherited property and its value is a boolean. It can control behavior for arrays and array-like objects:
- For array objects, the default behavior is to spread (flatten) ele... | [
-0.5513592958450317,
-0.10508131235837936,
-1.1577610969543457,
0.3678220808506012,
-0.7771561741828918,
-2.0839173793792725,
0.19449542462825775,
1.1431725025177002,
0.33094045519828796,
-0.04054609313607216,
-1.3050345182418823,
1.1277188062667847,
-0.8219252228736877,
-0.249979406595230... |
javascript/reference/global_objects/symbol/isconcatspreadable/index.md | JavaScript - Global Objects - Symbol - isConcatSpreadable - Examples - Arrays:
By default, `Array.prototype.concat()` spreads (flattens) arrays into its result:
Example:
const alpha = ["a", "b", "c"];
const numeric = [1, 2, 3];
const alphaNumeric = alpha.concat(numeric);
console.log(alphaNumeric); // Result: ['a',... | [
-0.192676842212677,
-0.67877596616745,
-1.8575429916381836,
-0.24250629544258118,
-0.5648105144500732,
-1.5631378889083862,
0.29717597365379333,
1.1338796615600586,
0.05949212238192558,
-0.016133537515997887,
-0.9764582514762878,
1.1142901182174683,
-0.3128436505794525,
-0.3071112036705017... |
javascript/reference/global_objects/symbol/isconcatspreadable/index.md | JavaScript - Global Objects - Symbol - isConcatSpreadable - Examples - Array-like objects:
For array-like objects, the default is to not spread. `Symbol.isConcatSpreadable` needs to be set to `true` in order to get a flattened array:
Example:
const x = [1, 2, 3];
const fakeArray = {
[Symbol.isConcatSpreadable]: t... | [
-0.448521226644516,
-0.3236667811870575,
-1.3235608339309692,
0.515264093875885,
-0.3428983688354492,
-1.660987377166748,
0.1975962519645691,
0.992516279220581,
-0.4147721230983734,
0.0476682186126709,
-1.003088355064392,
0.808243453502655,
-0.6876397728919983,
-0.25637948513031006,
0.46... |
javascript/reference/global_objects/symbol/split/index.md | JavaScript - Global Objects - Symbol - split:
The `Symbol.split` static data property represents the well-known symbol `Symbol.split`. The `String.prototype.split()` method looks up this symbol on its first argument for the method that splits a string at the indices that match the current object.
For more information... | [
-0.20484092831611633,
-0.08253256231546402,
-0.5298287272453308,
0.5742519497871399,
0.5869399309158325,
-0.5357512831687927,
-0.04719844460487366,
0.4458144009113312,
-0.24423810839653015,
-0.28770336508750916,
-0.5093921422958374,
0.43348172307014465,
-0.09483827650547028,
0.154492005705... |
javascript/reference/global_objects/symbol/split/index.md | JavaScript - Global Objects - Symbol - split - Value:
The well-known symbol `Symbol.split`. | [
0.0979282334446907,
0.5180718302726746,
-0.7848488688468933,
-0.0759488195180893,
-0.6008049249649048,
-2.2467188835144043,
0.6614354252815247,
0.6971649527549744,
0.03442505747079849,
-0.2577061951160431,
-0.6506121158599854,
0.5570277571678162,
0.07045581191778183,
0.6401744484901428,
... |
javascript/reference/global_objects/symbol/split/index.md | JavaScript - Global Objects - Symbol - split - Examples - Custom reverse split:
Example:
class ReverseSplit {
[Symbol.split](string) {
const array = string.split(" ");
return array.reverse();
}
}
console.log("Another one bites the dust".split(new ReverseSplit()));
// [ "dust", "the", "bites", "one", "Ano... | [
-0.5111671090126038,
0.523503303527832,
-0.6979641914367676,
0.023223286494612694,
-0.26626357436180115,
-2.202702760696411,
0.3409556746482849,
0.5696290731430054,
-0.14686249196529388,
0.6916109919548035,
-0.5505408048629761,
0.5952995419502258,
0.027383703738451004,
-0.3666645586490631,... |
javascript/reference/global_objects/float64array/index.md | JavaScript - Global Objects - Float64Array:
The `Float64Array` typed array represents an array of 64-bit floating point numbers in the platform byte order. If control over byte order is needed, use `DataView` instead. The contents are initialized to `0` unless initialization data is explicitly provided. Once establish... | [
0.1450512856245041,
-0.6413826942443848,
-1.0134971141815186,
-0.037146370857954025,
0.6323530673980713,
-0.4486897587776184,
0.4876767694950104,
1.4186205863952637,
0.6404350399971008,
0.27266180515289307,
-0.4207259714603424,
0.2586110532283783,
0.14531807601451874,
0.04056796804070473,
... |
javascript/reference/global_objects/float64array/index.md | JavaScript - Global Objects - Float64Array - Constructor:
- `Float64Array()`: Creates a new `Float64Array` object. | [
-0.4776442348957062,
-0.09653688222169876,
-1.000539779663086,
-0.14688505232334137,
-0.11352553218603134,
-0.581340491771698,
-0.6518334746360779,
1.1632294654846191,
0.3409772515296936,
-0.1429118812084198,
-0.3584941327571869,
-0.14723052084445953,
-0.2556425929069519,
-0.12874685227870... |
javascript/reference/global_objects/float64array/index.md | JavaScript - Global Objects - Float64Array - Static properties:
Also inherits static properties from its parent `TypedArray`.
- `Float64Array.BYTES_PER_ELEMENT`: Returns a number value of the element size. `8` in the case of `Float64Array`. | [
-0.4683978259563446,
0.059661865234375,
-0.9967431426048279,
-0.385184109210968,
-0.12621526420116425,
-1.2607762813568115,
0.4338459074497223,
1.0303634405136108,
-0.12308283150196075,
-0.20318719744682312,
-0.4948762059211731,
0.786099374294281,
-0.7652412056922913,
-0.11793021112680435,... |
javascript/reference/global_objects/float64array/index.md | JavaScript - Global Objects - Float64Array - Static methods:
Inherits static methods from its parent `TypedArray`. | [
0.04540633037686348,
0.14890459179878235,
-0.954756498336792,
-0.30834800004959106,
0.01385305542498827,
-0.9535883069038391,
0.5868578553199768,
1.8253626823425293,
-0.1568353772163391,
-0.076039619743824,
-0.6855230927467346,
-0.27109822630882263,
-0.6438370943069458,
-0.1476615816354751... |
javascript/reference/global_objects/float64array/index.md | JavaScript - Global Objects - Float64Array - Instance properties:
Also inherits instance properties from its parent `TypedArray`.
These properties are defined on `Float64Array.prototype` and shared by all `Float64Array` instances.
- `Float64Array.prototype.BYTES_PER_ELEMENT`: Returns a number value of the element si... | [
0.5322968363761902,
-0.39907336235046387,
-0.5207672715187073,
0.3110883831977844,
0.6390388607978821,
-0.32462435960769653,
0.28541290760040283,
0.8082212209701538,
0.32439547777175903,
-0.22586940228939056,
-0.6301211714744568,
0.4779609739780426,
-0.011813702061772346,
-0.18174663186073... |
javascript/reference/global_objects/float64array/index.md | JavaScript - Global Objects - Float64Array - Instance methods:
Inherits instance methods from its parent `TypedArray`. | [
0.433179646730423,
-0.04679988697171211,
-0.6225235462188721,
-0.061668023467063904,
-0.1571298986673355,
-0.6679108738899231,
0.6128930449485779,
1.2665492296218872,
-0.19943948090076447,
-0.4653242528438568,
-0.43782058358192444,
0.10493601858615875,
-0.527159571647644,
0.183402210474014... |
javascript/reference/global_objects/float64array/index.md | JavaScript - Global Objects - Float64Array - Examples - Different ways to create a Float64Array:
Example:
// From a length
const float64 = new Float64Array(2);
float64[0] = 42;
console.log(float64[0]); // 42
console.log(float64.length); // 2
console.log(float64.BYTES_PER_ELEMENT); // 8
// From an array
const x = new... | [
0.4529620409011841,
-0.27671563625335693,
-0.7152944803237915,
-0.14047527313232422,
0.33754509687423706,
-0.3523901700973511,
-0.8987389206886292,
0.6055099964141846,
0.4302758574485779,
-0.10914269089698792,
0.15146805346012115,
0.5243920087814331,
-0.6629434823989868,
-0.190089598298072... |
javascript/reference/global_objects/float64array/float64array/index.md | JavaScript - Global Objects - Float64Array:
The `Float64Array()` constructor creates `Float64Array` objects. The contents are initialized to `0` unless initialization data is explicitly provided. | [
0.019682588055729866,
-0.10214590281248093,
-0.6833481192588806,
0.3489651679992676,
-0.10658423602581024,
-0.7381882071495056,
-0.2131214588880539,
1.0332547426223755,
0.03483716771006584,
0.16129601001739502,
-0.46897220611572266,
-0.3791203796863556,
-0.422812819480896,
-0.4758692383766... |
javascript/reference/global_objects/float64array/float64array/index.md | JavaScript - Global Objects - Float64Array - Syntax:
Example:
new Float64Array()
new Float64Array(length)
new Float64Array(typedArray)
new Float64Array(object)
new Float64Array(buffer)
new Float64Array(buffer, byteOffset)
new Float64Array(buffer, byteOffset, length)
Note: `Float64Array()` can only be constructed wi... | [
0.13274656236171722,
0.02359093725681305,
-0.9107665419578552,
-0.7284537553787231,
-0.08693918585777283,
-0.8835468292236328,
-0.8590442538261414,
1.3032084703445435,
0.5650821924209595,
-0.1831086426973343,
-0.036679282784461975,
0.2784538269042969,
-0.0029940251260995865,
0.008782761171... |
javascript/reference/global_objects/float64array/float64array/index.md | JavaScript - Global Objects - Float64Array - Syntax - Parameters:
See `TypedArray`. | [
0.7967059016227722,
0.029023971408605576,
-0.8368009924888611,
-0.40312957763671875,
-0.33605214953422546,
-0.42338961362838745,
0.1314043551683426,
1.2991732358932495,
0.32977908849716187,
0.15274284780025482,
-0.24054579436779022,
0.28583088517189026,
0.2842378616333008,
0.18181522190570... |
javascript/reference/global_objects/float64array/float64array/index.md | JavaScript - Global Objects - Float64Array - Syntax - Exceptions:
See `TypedArray`. | [
0.4374486804008484,
-0.272428959608078,
-0.5592332482337952,
-0.10263940691947937,
-0.4392393231391907,
-0.800693154335022,
-0.19763700664043427,
1.421399474143982,
0.1524500995874405,
-0.05385967344045639,
0.029799088835716248,
-0.037732865661382675,
-0.054215673357248306,
0.1376560926437... |
javascript/reference/global_objects/float64array/float64array/index.md | JavaScript - Global Objects - Float64Array - Examples - Different ways to create a Float64Array:
Example:
// From a length
const float64 = new Float64Array(2);
float64[0] = 42;
console.log(float64[0]); // 42
console.log(float64.length); // 2
console.log(float64.BYTES_PER_ELEMENT); // 8
// From an array
const x = new... | [
0.4529620409011841,
-0.27671563625335693,
-0.7152944803237915,
-0.14047527313232422,
0.33754509687423706,
-0.3523901700973511,
-0.8987389206886292,
0.6055099964141846,
0.4302758574485779,
-0.10914269089698792,
0.15146805346012115,
0.5243920087814331,
-0.6629434823989868,
-0.190089598298072... |
javascript/reference/global_objects/atomics/index.md | JavaScript - Global Objects - Atomics:
The `Atomics` namespace object contains static methods for carrying out atomic operations. They are used with `SharedArrayBuffer` and `ArrayBuffer` objects. | [
0.2874061167240143,
-0.09982895851135254,
-1.2339727878570557,
0.22887754440307617,
0.15179187059402466,
-2.0719754695892334,
1.0514334440231323,
0.7317856550216675,
0.7199854850769043,
0.6953486800193787,
-0.949112057685852,
-0.9303392767906189,
0.35006365180015564,
0.051614005118608475,
... |
javascript/reference/global_objects/atomics/index.md | JavaScript - Global Objects - Atomics - Description:
Unlike most global objects, `Atomics` is not a constructor. You cannot use it with the `new` operator or invoke the `Atomics` object as a function. All properties and methods of `Atomics` are static (just like the `Math` object). | [
0.13603685796260834,
-0.010311155579984188,
-0.7744972705841064,
-0.14010021090507507,
-0.441701740026474,
-3.2398476600646973,
-0.22708366811275482,
0.9696758389472961,
0.5632269382476807,
-0.18685734272003174,
-0.7315482497215271,
-0.7879136204719543,
0.41272854804992676,
-0.320985108613... |
javascript/reference/global_objects/atomics/index.md | JavaScript - Global Objects - Atomics - Description - Atomic operations:
When memory is shared, multiple threads can read and write the same data in memory. Atomic operations make sure that predictable values are written and read, that operations are finished before the next operation starts and that operations are no... | [
0.5114719271659851,
0.38195741176605225,
-1.0829498767852783,
-0.002272001700475812,
-0.1951584368944168,
-1.3027147054672241,
0.2372821867465973,
0.5925411581993103,
0.9614807963371277,
-0.056333862245082855,
-0.9077414274215698,
-1.3549823760986328,
0.04417695850133896,
0.300449609756469... |
javascript/reference/global_objects/atomics/index.md | JavaScript - Global Objects - Atomics - Description - Wait and notify:
The `wait()` and `notify()` methods are modeled on Linux futexes ("fast user-space mutex") and provide ways for waiting until a certain condition becomes true and are typically used as blocking constructs. | [
-0.432221919298172,
0.3811503052711487,
-0.3387998044490814,
0.39320680499076843,
-0.4628072679042816,
-2.5026333332061768,
0.6411453485488892,
1.1782265901565552,
0.22019319236278534,
0.7413522005081177,
-0.7586634755134583,
-0.227677583694458,
-0.06917890906333923,
-0.031605616211891174,... |
javascript/reference/global_objects/atomics/index.md | JavaScript - Global Objects - Atomics - Static properties:
- `Atomics[Symbol.toStringTag]`: The initial value of the `[Symbol.toStringTag]` property is the string `"Atomics"`. This property is used in `Object.prototype.toString()`. | [
-0.6057170629501343,
0.480058878660202,
-0.02613021619617939,
-0.45328447222709656,
-0.2376435399055481,
-3.303466320037842,
0.8328637480735779,
0.9192675948143005,
0.28338709473609924,
-0.461638480424881,
-0.9827946424484253,
-0.7116917967796326,
0.046908289194107056,
-0.5385170578956604,... |
javascript/reference/global_objects/atomics/index.md | JavaScript - Global Objects - Atomics - Static methods:
- `Atomics.add()`: Adds the provided value to the existing value at the specified index of the array. Returns the old value at that index.
- `Atomics.and()`: Computes a bitwise AND on the value at the specified index of the array with the provided value. Returns ... | [
0.45505261421203613,
-0.16579669713974,
-0.8081080913543701,
0.43171218037605286,
0.19497600197792053,
-0.5572903752326965,
0.8095833659172058,
0.6849934458732605,
0.5885017514228821,
-0.028989996761083603,
-1.3089417219161987,
-0.35308679938316345,
-0.413906455039978,
0.5263471603393555,
... |
javascript/reference/global_objects/atomics/index.md | JavaScript - Global Objects - Atomics - Examples:
Note that these examples cannot be run directly from the console or an arbitrary web page, because `SharedArrayBuffer` is not defined unless its security requirements are met. | [
0.7470375299453735,
0.692237138748169,
-1.5648642778396606,
-0.28888580203056335,
-0.8828091025352478,
-0.6043067574501038,
0.8044332265853882,
0.25380170345306396,
0.08313668519258499,
-0.32444578409194946,
0.10329372435808182,
-0.007187326904386282,
-0.5328009128570557,
-0.60853630304336... |
javascript/reference/global_objects/atomics/index.md | JavaScript - Global Objects - Atomics - Examples - Using Atomics:
Example:
const sab = new SharedArrayBuffer(1024);
const ta = new Uint8Array(sab);
ta[0]; // 0
ta[0] = 5; // 5
Atomics.add(ta, 0, 12); // 5
Atomics.load(ta, 0); // 17
Atomics.and(ta, 0, 1); // 17
Atomics.load(ta, 0); // 1
Atomics.compareExchange(ta,... | [
0.7310256361961365,
0.06934463977813721,
-1.0082612037658691,
0.18597598373889923,
-0.3906630277633667,
-1.52768075466156,
0.7711007595062256,
0.20645563304424286,
0.4254406988620758,
0.5172985196113586,
-0.642819344997406,
-0.2936807870864868,
-0.6128228306770325,
-0.22846189141273499,
... |
javascript/reference/global_objects/atomics/index.md | JavaScript - Global Objects - Atomics - Examples - Waiting and notifying:
Given a shared `Int32Array`:
Example:
const sab = new SharedArrayBuffer(1024);
const int32 = new Int32Array(sab);
A reading thread is sleeping and waiting on location 0 because the provided value matches what is stored at the provided index. ... | [
0.2125817984342575,
-0.02773202769458294,
-0.2832109034061432,
0.3086646497249603,
-0.05891742184758186,
-1.685498595237732,
-0.7421867847442627,
0.6255238652229309,
0.07415545731782913,
0.02922241948544979,
0.35977616906166077,
-0.6665465235710144,
-0.5924209356307983,
-0.078093022108078,... |
javascript/reference/global_objects/atomics/store/index.md | JavaScript - Global Objects - Atomics - store:
The `Atomics.store()` static method stores a given value at a given position in the array and returns that value. This atomic operation guarantees that the write is tear-free, and that all atomic writes are sequentially consistent.
Note that unlike many other `Atomic` me... | [
0.14179064333438873,
-0.13134396076202393,
-1.1026971340179443,
0.05968175455927849,
0.4940807819366455,
-2.035219669342041,
0.16362498700618744,
1.208608627319336,
0.23968639969825745,
0.17984752357006073,
-0.13150595128536224,
-0.44964414834976196,
0.07646280527114868,
-0.080528348684310... |
javascript/reference/global_objects/atomics/store/index.md | JavaScript - Global Objects - Atomics - store - Syntax:
Example:
Atomics.store(typedArray, index, value) | [
0.932471752166748,
-0.15598370134830475,
-0.5874087810516357,
0.18802136182785034,
-0.6889359354972839,
-1.6011548042297363,
-0.3907889723777771,
0.8711321949958801,
0.36733120679855347,
-0.6319448351860046,
0.23333609104156494,
-0.41551393270492554,
-0.34136679768562317,
-0.20707094669342... |
javascript/reference/global_objects/atomics/store/index.md | JavaScript - Global Objects - Atomics - store - Syntax - Parameters:
- `typedArray`: An integer typed array. One of `Int8Array`, `Uint8Array`, `Int16Array`, `Uint16Array`, `Int32Array`, `Uint32Array`, `BigInt64Array`, or `BigUint64Array`.
- `index`: The position in the `typedArray` to store a `value` in.
- `value`: Th... | [
1.0773478746414185,
-0.5870195031166077,
-1.1221330165863037,
0.2905239462852478,
0.05984208360314369,
-0.9610798358917236,
-0.5645043849945068,
1.0368235111236572,
0.6334308385848999,
-0.10382141172885895,
-0.3355792164802551,
0.1585393249988556,
-1.0926026105880737,
0.5532039403915405,
... |
javascript/reference/global_objects/atomics/store/index.md | JavaScript - Global Objects - Atomics - store - Syntax - Return value:
The value that has been stored. | [
1.1448757648468018,
0.1563979685306549,
-0.833332896232605,
-0.21318665146827698,
-0.6215810179710388,
-1.9073383808135986,
0.2572743594646454,
1.1956504583358765,
0.004615774843841791,
-0.24029532074928284,
-0.5358120203018188,
0.43017858266830444,
-0.8741872310638428,
1.207654356956482,
... |
javascript/reference/global_objects/atomics/store/index.md | JavaScript - Global Objects - Atomics - store - Syntax - Exceptions:
- `TypeError`: Thrown if `typedArray` is not one of the allowed integer types.
- `RangeError`: Thrown if `index` is out of bounds in the `typedArray`. | [
0.2544223666191101,
-0.32784977555274963,
-0.36207717657089233,
0.56707763671875,
-0.20883885025978088,
-1.9287832975387573,
-0.8242596983909607,
0.8499940037727356,
-0.18435215950012207,
-0.1775953322649002,
-0.620586633682251,
-0.195151224732399,
-0.6811890006065369,
-0.5204799771308899,... |
javascript/reference/global_objects/atomics/store/index.md | JavaScript - Global Objects - Atomics - store - Examples:
Note that these examples cannot be run directly from the console or an arbitrary web page, because `SharedArrayBuffer` is not defined unless its security requirements are met. | [
0.8914153575897217,
0.563412070274353,
-1.712507963180542,
-0.0012387856841087341,
-0.7723527550697327,
-0.33879730105400085,
0.5054535269737244,
0.2630048990249634,
0.23333241045475006,
-0.2853251099586487,
0.15861622989177704,
0.08411937952041626,
-0.7311592102050781,
-0.4915611445903778... |
javascript/reference/global_objects/atomics/store/index.md | JavaScript - Global Objects - Atomics - store - Examples - Using Atomics.store():
Example:
// Create a SharedArrayBuffer with a size in bytes
const sab = new SharedArrayBuffer(1024);
const ta = new Uint8Array(sab);
console.log(Atomics.store(ta, 0, 12)); // 12, the new/current value
console.log(Atomics.load(ta, 0)); ... | [
0.6885578036308289,
0.015478871762752533,
-1.0432648658752441,
0.7058456540107727,
-0.1384391188621521,
-1.048555850982666,
-0.4265502691268921,
-0.04550487548112869,
0.5716201663017273,
0.10939855128526688,
0.33829042315483093,
0.15050378441810608,
-0.3488466143608093,
-0.6257539391517639... |
javascript/reference/global_objects/atomics/or/index.md | JavaScript - Global Objects - Atomics - or:
The `Atomics.or()` static method computes a bitwise OR with a given value at a given position in the array, and returns the old value at that position. This atomic operation guarantees that no other write happens until the modified value is written back. | [
0.09710933268070221,
0.0628696009516716,
-0.25213244557380676,
-0.028797440230846405,
0.06578456610441208,
-1.914725661277771,
0.8302624225616455,
0.8335555791854858,
0.5084432363510132,
0.32080498337745667,
-0.5909079313278198,
-0.7585012912750244,
0.4735885560512543,
-0.300277978181839,
... |
javascript/reference/global_objects/atomics/or/index.md | JavaScript - Global Objects - Atomics - or - Syntax:
Example:
Atomics.or(typedArray, index, value) | [
0.8335059881210327,
-0.13082998991012573,
-0.06819330900907516,
-0.3175666928291321,
-0.649079442024231,
-2.2306535243988037,
-0.2021624743938446,
0.7391895055770874,
0.41713497042655945,
-0.3380875587463379,
-0.38047367334365845,
-0.7666167616844177,
-0.28481781482696533,
-0.4313843846321... |
javascript/reference/global_objects/atomics/or/index.md | JavaScript - Global Objects - Atomics - or - Syntax - Parameters:
- `typedArray`: An integer typed array. One of `Int8Array`, `Uint8Array`, `Int16Array`, `Uint16Array`, `Int32Array`, `Uint32Array`, `BigInt64Array`, or `BigUint64Array`.
- `index`: The position in the `typedArray` to compute the bitwise OR.
- `value`: T... | [
0.9736618995666504,
-0.46014484763145447,
-0.9233454465866089,
-0.09133753180503845,
0.24232123792171478,
-1.2389580011367798,
-0.30111733078956604,
0.7678535580635071,
0.6849068403244019,
0.643390417098999,
-0.4892578721046448,
-0.12644241750240326,
-0.5547407865524292,
0.3480901420116424... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.