file stringlengths 16 94 | text stringlengths 32 24.4k | vector list |
|---|---|---|
javascript/reference/global_objects/int32array/index.md | JavaScript - Global Objects - Int32Array:
The `Int32Array` typed array represents an array of 32-bit signed integers 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 established, you can... | [
-0.4603320062160492,
-0.19290019571781158,
-0.5648031830787659,
0.9708170294761658,
0.8468165397644043,
-1.331140398979187,
0.4583515226840973,
1.4096336364746094,
-0.048540305346250534,
0.9576136469841003,
-0.4032873213291168,
-0.09963077306747437,
0.08958741277456284,
-0.0416451171040535... |
javascript/reference/global_objects/int32array/index.md | JavaScript - Global Objects - Int32Array - Constructor:
- `Int32Array()`: Creates a new `Int32Array` object. | [
-0.7560251951217651,
0.23413945734500885,
-0.7710283398628235,
1.0620250701904297,
-0.003907603677362204,
-1.1613497734069824,
-0.8971709609031677,
0.7906200885772705,
0.1487053632736206,
0.14232487976551056,
-0.3315845727920532,
-0.4422093331813812,
-0.07021916657686234,
-0.10771784186363... |
javascript/reference/global_objects/int32array/index.md | JavaScript - Global Objects - Int32Array - Static properties:
Also inherits static properties from its parent `TypedArray`.
- `Int32Array.BYTES_PER_ELEMENT`: Returns a number value of the element size. `4` in the case of `Int32Array`. | [
-0.7008875608444214,
0.7602314352989197,
-0.7794286012649536,
0.5630837678909302,
0.015322703868150711,
-1.5178056955337524,
0.42012709379196167,
0.8155704140663147,
-0.12341935187578201,
-0.004902796354144812,
-0.4479120671749115,
0.567142128944397,
-0.41250455379486084,
-0.20605885982513... |
javascript/reference/global_objects/int32array/index.md | JavaScript - Global Objects - Int32Array - Static methods:
Inherits static methods from its parent `TypedArray`. | [
-0.4488857090473175,
0.2924627363681793,
-0.918134331703186,
0.23824284970760345,
0.07869851589202881,
-1.354947805404663,
0.45430895686149597,
1.6914223432540894,
-0.3825049102306366,
0.11552663147449493,
-0.6761018633842468,
-0.5588106513023376,
-0.4886765480041504,
-0.10593996196985245,... |
javascript/reference/global_objects/int32array/index.md | JavaScript - Global Objects - Int32Array - Instance properties:
Also inherits instance properties from its parent `TypedArray`.
These properties are defined on `Int32Array.prototype` and shared by all `Int32Array` instances.
- `Int32Array.prototype.BYTES_PER_ELEMENT`: Returns a number value of the element size. `4` ... | [
-0.13722312450408936,
0.23072472214698792,
-0.6531899571418762,
0.6676655411720276,
0.1384812444448471,
-1.3895666599273682,
-0.17019125819206238,
0.7056480646133423,
0.3616948127746582,
0.1777501255273819,
-0.5272291898727417,
0.38665351271629333,
-0.7676681280136108,
0.40474119782447815,... |
javascript/reference/global_objects/int32array/index.md | JavaScript - Global Objects - Int32Array - Instance methods:
Inherits instance methods from its parent `TypedArray`. | [
0.024808255955576897,
0.05773413926362991,
-0.5395192503929138,
0.45101767778396606,
-0.24277929961681366,
-1.2058075666427612,
0.4523770213127136,
1.0989983081817627,
-0.4217030704021454,
-0.3773634135723114,
-0.5002089142799377,
-0.2994547486305237,
-0.40112245082855225,
0.32769712805747... |
javascript/reference/global_objects/int32array/index.md | JavaScript - Global Objects - Int32Array - Examples - Different ways to create an Int32Array:
Example:
// From a length
const int32 = new Int32Array(2);
int32[0] = 42;
console.log(int32[0]); // 42
console.log(int32.length); // 2
console.log(int32.BYTES_PER_ELEMENT); // 4
// From an array
const x = new Int32Array([21... | [
0.02612212486565113,
0.3668154180049896,
-0.5380898118019104,
0.9492650032043457,
0.5036393404006958,
-0.8245670199394226,
-1.3854402303695679,
0.20665408670902252,
0.31525588035583496,
0.19145993888378143,
0.46161362528800964,
0.13246706128120422,
-0.3742145895957947,
-0.12468534708023071... |
javascript/reference/global_objects/int32array/int32array/index.md | JavaScript - Global Objects - Int32Array:
The `Int32Array()` constructor creates `Int32Array` objects. The contents are initialized to `0` unless initialization data is explicitly provided. | [
-0.2841176390647888,
0.31212806701660156,
-0.47823411226272583,
1.378330945968628,
-0.18190622329711914,
-1.3578007221221924,
-0.343705415725708,
0.6582949161529541,
-0.14230482280254364,
0.334403932094574,
-0.43651634454727173,
-0.6226006746292114,
-0.3749069571495056,
-0.3781940340995788... |
javascript/reference/global_objects/int32array/int32array/index.md | JavaScript - Global Objects - Int32Array - Syntax:
Example:
new Int32Array()
new Int32Array(length)
new Int32Array(typedArray)
new Int32Array(object)
new Int32Array(buffer)
new Int32Array(buffer, byteOffset)
new Int32Array(buffer, byteOffset, length)
Note: `Int32Array()` can only be constructed with `new`. Attempti... | [
-0.46218109130859375,
0.3284951150417328,
-0.7230614423751831,
0.4369373619556427,
0.16994263231754303,
-1.4417343139648438,
-1.1518409252166748,
0.9189853072166443,
0.4148291051387787,
0.021971261128783226,
0.12189266830682755,
0.057011742144823074,
0.15645115077495575,
0.3181679248809814... |
javascript/reference/global_objects/int32array/int32array/index.md | JavaScript - Global Objects - Int32Array - Syntax - Parameters:
See `TypedArray`. | [
0.22185596823692322,
0.24722100794315338,
-0.6624634861946106,
0.3725825548171997,
-0.13363038003444672,
-0.9665365219116211,
0.01605900004506111,
0.9860342144966125,
0.04913504421710968,
0.2367592751979828,
-0.28266018629074097,
-0.0843764916062355,
0.3502070903778076,
0.27420562505722046... |
javascript/reference/global_objects/int32array/int32array/index.md | JavaScript - Global Objects - Int32Array - Syntax - Exceptions:
See `TypedArray`. | [
-0.1958235800266266,
-0.09342452883720398,
-0.39805492758750916,
0.6344412565231323,
-0.2835802435874939,
-1.421104907989502,
-0.3663500249385834,
1.0922547578811646,
-0.1684785932302475,
0.08808577805757523,
-0.0012186291860416532,
-0.40903180837631226,
0.03532866761088371,
0.258170366287... |
javascript/reference/global_objects/int32array/int32array/index.md | JavaScript - Global Objects - Int32Array - Examples - Different ways to create an Int32Array:
Example:
// From a length
const int32 = new Int32Array(2);
int32[0] = 42;
console.log(int32[0]); // 42
console.log(int32.length); // 2
console.log(int32.BYTES_PER_ELEMENT); // 4
// From an array
const x = new Int32Array([21... | [
0.02612212486565113,
0.3668154180049896,
-0.5380898118019104,
0.9492650032043457,
0.5036393404006958,
-0.8245670199394226,
-1.3854402303695679,
0.20665408670902252,
0.31525588035583496,
0.19145993888378143,
0.46161362528800964,
0.13246706128120422,
-0.3742145895957947,
-0.12468534708023071... |
javascript/reference/global_objects/symbol/tostringtag/index.md | JavaScript - Global Objects - Symbol - toStringTag:
The `Symbol.toStringTag` static data property represents the well-known symbol `Symbol.toStringTag`. `Object.prototype.toString()` looks up this symbol on the `this` value for the property containing a string that represents the type of the object.
Example:
class V... | [
-1.8124196529388428,
-0.5071773529052734,
-0.32813557982444763,
-0.4077067971229553,
0.09709125757217407,
-2.8058888912200928,
-0.21669915318489075,
0.9292017817497253,
0.03474418446421623,
-0.34679174423217773,
-0.7952263951301575,
0.5443778038024902,
-0.09176609665155411,
-0.079142004251... |
javascript/reference/global_objects/symbol/tostringtag/index.md | JavaScript - Global Objects - Symbol - toStringTag - Value:
The well-known symbol `Symbol.toStringTag`. | [
-0.8590453863143921,
0.29282400012016296,
-0.5057997703552246,
-0.5056355595588684,
-0.4544517993927002,
-2.940927743911743,
0.3561062216758728,
0.6385267972946167,
-0.22765089571475983,
-0.8895777463912964,
-0.6610994338989258,
-0.21706387400627136,
-0.105365090072155,
0.2822658121585846,... |
javascript/reference/global_objects/symbol/tostringtag/index.md | JavaScript - Global Objects - Symbol - toStringTag - Examples - Default tags:
Some values do not have `Symbol.toStringTag`, but have special `toString()` representations. For a complete list, see `Object.prototype.toString()`.
Example:
Object.prototype.toString.call("foo"); // "[object String]"
Object.prototype.toSt... | [
-1.7357361316680908,
0.07135053724050522,
-0.6610432863235474,
-0.3531944453716278,
-0.1442941129207611,
-2.694880247116089,
-0.2807808518409729,
-0.052683472633361816,
-0.5603480935096741,
-0.3171257972717285,
-0.26885485649108887,
0.1640404313802719,
0.11935058981180191,
-0.3394210636615... |
javascript/reference/global_objects/symbol/tostringtag/index.md | JavaScript - Global Objects - Symbol - toStringTag - Examples - Built-in toStringTag symbols:
Most built-in objects provide their own `[Symbol.toStringTag]` property. Almost all built-in objects' `[Symbol.toStringTag]` property is not writable, not enumerable, and configurable; the exception is `Iterator`, which is wr... | [
-0.2551438510417938,
0.07214841991662979,
-0.22382156550884247,
0.5869119763374329,
0.40941429138183594,
-1.806514859199524,
0.41136446595191956,
1.2975879907608032,
-0.5624508857727051,
0.451249897480011,
-0.910020649433136,
0.4315769672393799,
-0.0365818589925766,
-0.21522147953510284,
... |
javascript/reference/global_objects/symbol/tostringtag/index.md | JavaScript - Global Objects - Symbol - toStringTag - Examples - Custom tag with toStringTag:
When creating your own class, JavaScript defaults to the "Object" tag:
Example:
class ValidatorClass {}
Object.prototype.toString.call(new ValidatorClass()); // "[object Object]"
Now, with the help of `toStringTag`, you ar... | [
-1.1155259609222412,
-0.5408241748809814,
-0.4361843466758728,
0.00856081023812294,
0.36055922508239746,
-2.6609532833099365,
-0.4924801290035248,
-0.3279149532318115,
-0.7548091411590576,
-0.5966721177101135,
-0.44079041481018066,
0.15332892537117004,
-0.4090815782546997,
-0.0763963535428... |
javascript/reference/global_objects/symbol/tostringtag/index.md | JavaScript - Global Objects - Symbol - toStringTag - Examples - toStringTag available on all DOM prototype objects:
Due to a WebIDL spec change in mid-2020, browsers are adding a `Symbol.toStringTag` property to all DOM prototype objects. For example, to access the `Symbol.toStringTag` property on `HTMLButtonElement`:... | [
-1.6451994180679321,
0.2692683935165405,
0.19986556470394135,
-0.4786057770252228,
-0.25075480341911316,
-2.408933162689209,
-0.10292818397283554,
0.6356634497642517,
-0.22092881798744202,
-0.5615487098693848,
-0.2701018452644348,
0.3811861276626587,
-0.14809344708919525,
-0.31155261397361... |
javascript/reference/global_objects/symbol/symbol.toprimitive/index.md | JavaScript - Global Objects - Symbol - Symbol.toPrimitive:
The `[Symbol.toPrimitive]()` method of `Symbol` values returns this symbol value. | [
-0.8016941547393799,
0.5763103365898132,
-0.11850428581237793,
-0.6233688592910767,
-0.9041415452957153,
-2.3282675743103027,
1.2604479789733887,
1.4904996156692505,
-0.4825027883052826,
-0.25620394945144653,
-1.0768887996673584,
-0.14200206100940704,
0.22196924686431885,
0.404094398021698... |
javascript/reference/global_objects/symbol/symbol.toprimitive/index.md | JavaScript - Global Objects - Symbol - Symbol.toPrimitive - Syntax:
Example:
symbolValue[Symbol.toPrimitive](hint) | [
-0.8592004776000977,
0.5089581608772278,
0.38892805576324463,
-0.3297484815120697,
-0.7974219918251038,
-2.6484525203704834,
0.7572284936904907,
1.1598892211914062,
-0.28317809104919434,
-0.29100239276885986,
-0.8884191513061523,
-0.13823534548282623,
-0.4745815396308899,
0.033212695270776... |
javascript/reference/global_objects/symbol/symbol.toprimitive/index.md | JavaScript - Global Objects - Symbol - Symbol.toPrimitive - Syntax - Parameters:
- `hint`: A string value indicating the primitive value to return. The value is ignored. | [
-0.9532967805862427,
0.07196154445409775,
-0.47950035333633423,
0.22494392096996307,
-0.38338643312454224,
-3.1375436782836914,
1.755737066268921,
1.0446966886520386,
-0.8200434446334839,
-0.0324949212372303,
-1.7243314981460571,
0.21764874458312988,
-0.9509940147399902,
0.5490807890892029... |
javascript/reference/global_objects/symbol/symbol.toprimitive/index.md | JavaScript - Global Objects - Symbol - Symbol.toPrimitive - Syntax - Return value:
The primitive value of the specified `Symbol` object. | [
-0.3158875107765198,
0.43231654167175293,
-0.4515111744403839,
-0.612226665019989,
-0.9191337823867798,
-1.980514645576477,
1.4409958124160767,
1.446519136428833,
-0.021541371941566467,
0.05990925803780556,
-0.9650600552558899,
0.5868867635726929,
-0.821103036403656,
0.8020807504653931,
... |
javascript/reference/global_objects/symbol/symbol.toprimitive/index.md | JavaScript - Global Objects - Symbol - Symbol.toPrimitive - Description:
The `[Symbol.toPrimitive]()` method of `Symbol` returns the primitive value of a Symbol object as a Symbol data type. The `hint` argument is not used.
JavaScript calls the `[Symbol.toPrimitive]()` method to convert an object to a primitive value... | [
-0.9268787503242493,
0.04416918754577637,
-0.40788543224334717,
0.08588054031133652,
-0.44230300188064575,
-2.5239601135253906,
1.8222044706344604,
0.7915661334991455,
-0.4741382300853729,
-0.1630377173423767,
-1.127428412437439,
0.3864475190639496,
-0.519664466381073,
0.11929989606142044,... |
javascript/reference/global_objects/symbol/symbol.toprimitive/index.md | JavaScript - Global Objects - Symbol - Symbol.toPrimitive - Examples - Using `[Symbol.toPrimitive]()`:
Example:
const sym = Symbol("example");
sym === sym[Symbol.toPrimitive](); // true | [
-0.524088978767395,
-0.04915258288383484,
0.1852022260427475,
-0.1539992392063141,
-0.6826311945915222,
-2.387976884841919,
0.6586850881576538,
0.8673651218414307,
-0.09392829239368439,
-0.01673259027302265,
-0.8912148475646973,
0.2062792032957077,
-0.44543999433517456,
-0.2185897827148437... |
javascript/reference/global_objects/symbol/matchall/index.md | JavaScript - Global Objects - Symbol - matchAll:
The `Symbol.matchAll` static data property represents the well-known symbol `Symbol.matchAll`. The `String.prototype.matchAll()` method looks up this symbol on its first argument for the method that returns an iterator, that yields matches of the current object against ... | [
-1.0904872417449951,
-0.11617238074541092,
-0.8975302577018738,
-0.2954336702823639,
0.6603145003318787,
-1.8374452590942383,
0.26245471835136414,
1.3591457605361938,
0.3460100591182709,
0.22325436770915985,
-1.0985873937606812,
0.6759521961212158,
0.4268375039100647,
0.46915820240974426,
... |
javascript/reference/global_objects/symbol/matchall/index.md | JavaScript - Global Objects - Symbol - matchAll - Value:
The well-known symbol `Symbol.matchAll`. | [
0.593021810054779,
0.1462697684764862,
-1.314491868019104,
-0.44952675700187683,
-0.4821690022945404,
-2.0905308723449707,
1.2243314981460571,
1.0496206283569336,
-0.272377610206604,
-0.5243016481399536,
-1.201709270477295,
-0.03438309580087662,
0.25726231932640076,
0.8576470017433167,
0... |
javascript/reference/global_objects/symbol/matchall/index.md | JavaScript - Global Objects - Symbol - matchAll - Examples - Using Symbol.matchAll:
Example:
const str = "2016-01-02|2019-03-07";
const numbers = {
*[Symbol.matchAll](str) {
for (const n of str.matchAll(/\d+/g)) yield n[0];
},
};
console.log(Array.from(str.matchAll(numbers)));
// ["2016", "01", "02", "2019"... | [
-0.5550068616867065,
0.19769147038459778,
-0.9056140184402466,
-0.4122542142868042,
0.2443089485168457,
-1.8685442209243774,
-0.1992078423500061,
0.5184012055397034,
0.06219739839434624,
0.24389377236366272,
-0.034390807151794434,
0.6639364957809448,
-0.039983540773391724,
0.47801312804222... |
javascript/reference/global_objects/symbol/toprimitive/index.md | JavaScript - Global Objects - Symbol - toPrimitive:
The `Symbol.toPrimitive` static data property represents the well-known symbol `Symbol.toPrimitive`. All type coercion algorithms look up this symbol on objects for the method that accepts a preferred type and returns a primitive representation of the object, before ... | [
-0.9392611384391785,
-0.5698460340499878,
-0.2889476418495178,
-0.47371092438697815,
-0.09015090018510818,
-2.2705068588256836,
0.683481752872467,
1.1541320085525513,
-0.04520493373274803,
0.2846241891384125,
-1.6449635028839111,
-0.34961485862731934,
-0.3830448091030121,
-0.15114560723304... |
javascript/reference/global_objects/symbol/toprimitive/index.md | JavaScript - Global Objects - Symbol - toPrimitive - Value:
The well-known symbol `Symbol.toPrimitive`. | [
-0.4899095296859741,
0.40746426582336426,
-0.2580636739730835,
-0.5540168285369873,
-0.7246431112289429,
-2.4021565914154053,
1.054762363433838,
0.937401533126831,
-0.2908175587654114,
-0.32269009947776794,
-1.2085304260253906,
-0.6557392477989197,
-0.5642477869987488,
0.35890886187553406,... |
javascript/reference/global_objects/symbol/toprimitive/index.md | JavaScript - Global Objects - Symbol - toPrimitive - Description:
With the help of the `Symbol.toPrimitive` property (used as a function value), an object can be converted to a primitive value. The function is called with a string argument `hint`, which specifies the preferred type of the result primitive value. The `... | [
-0.6722264289855957,
0.12080898135900497,
-0.5340803265571594,
-0.3168468475341797,
0.17524658143520355,
-2.461588144302368,
0.8120607733726501,
0.2755988538265228,
0.013757633045315742,
0.44524624943733215,
-1.358871340751648,
-0.10052715241909027,
-0.8914720416069031,
-0.1020829305052757... |
javascript/reference/global_objects/symbol/toprimitive/index.md | JavaScript - Global Objects - Symbol - toPrimitive - Examples - Modifying primitive values converted from an object:
Following example describes how `Symbol.toPrimitive` property can modify the primitive value converted from an object.
Example:
// An object without Symbol.toPrimitive property.
const obj1 = {};
conso... | [
-0.6442159414291382,
0.20298783481121063,
-0.24714885652065277,
0.08128277212381363,
-0.5361705422401428,
-2.828348159790039,
0.6741752624511719,
0.5686593651771545,
-0.09843836724758148,
-0.2280808836221695,
-1.1956068277359009,
-0.5028116703033447,
-1.2227205038070679,
-0.380224615335464... |
javascript/reference/global_objects/symbol/replace/index.md | JavaScript - Global Objects - Symbol - replace:
The `Symbol.replace` static data property represents the well-known symbol `Symbol.replace`. The `String.prototype.replace()` and `String.prototype.replaceAll()` methods look up this symbol on their first argument for the method that replaces substrings matched by the cu... | [
-0.5545068979263306,
-0.16849136352539062,
-0.79628986120224,
-0.0780627503991127,
-0.01853799819946289,
-2.6928229331970215,
0.3041246235370636,
1.4336731433868408,
0.7215626835823059,
-0.5356324315071106,
-0.7142236828804016,
-0.14154799282550812,
-0.18001781404018402,
0.2799166440963745... |
javascript/reference/global_objects/symbol/replace/index.md | JavaScript - Global Objects - Symbol - replace - Value:
The well-known symbol `Symbol.replace`. | [
0.37235695123672485,
0.4493209719657898,
-0.6929963827133179,
-0.49378523230552673,
-0.7228063344955444,
-2.609619379043579,
0.42069101333618164,
1.3949031829833984,
0.3159070611000061,
-1.2345845699310303,
-0.3875774145126343,
-0.018275978043675423,
-0.4953776001930237,
0.7517184019088745... |
javascript/reference/global_objects/symbol/replace/index.md | JavaScript - Global Objects - Symbol - replace - Examples - Using Symbol.replace:
Example:
class CustomReplacer {
constructor(value) {
this.value = value;
}
[Symbol.replace](string) {
return string.replace(this.value, "#!@?");
}
}
console.log("football".replace(new CustomReplacer("foo"))); // "#!@?tb... | [
-0.03575846180319786,
-0.05403883755207062,
-0.5443630218505859,
0.31521672010421753,
-0.13493981957435608,
-2.6023571491241455,
0.35816463828086853,
1.264454960823059,
-0.13060127198696136,
-0.6299801468849182,
0.44498103857040405,
0.19591191411018372,
-0.38490140438079834,
-0.34948229789... |
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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.