file stringlengths 16 94 | text stringlengths 32 24.4k | vector list |
|---|---|---|
javascript/reference/global_objects/arraybuffer/transfertofixedlength/index.md | JavaScript - Global Objects - ArrayBuffer - transferToFixedLength - Syntax - Exceptions:
- `TypeError`: Thrown if this `ArrayBuffer` is already detached, or if it can only be detached by designated operations. Currently, only certain web APIs are capable of creating `ArrayBuffer` objects with designated detaching meth... | [
-0.2031569480895996,
-0.13436046242713928,
-1.1630527973175049,
1.1347264051437378,
-0.5771174430847168,
-2.160836696624756,
-0.11763257533311844,
1.1992170810699463,
-0.1813475787639618,
0.26106661558151245,
-0.8047438263893127,
0.1197628527879715,
0.13522671163082123,
0.3661128580570221,... |
javascript/reference/global_objects/arraybuffer/transfertofixedlength/index.md | JavaScript - Global Objects - ArrayBuffer - transferToFixedLength - Description:
Unlike `transfer()`, `transferToFixedLength()` always creates a non-resizable `ArrayBuffer`. This means `newByteLength` can be larger than the `maxByteLength`, even if this `ArrayBuffer` is resizable. See transferring ArrayBuffers for mor... | [
-0.8277596831321716,
-0.37417319416999817,
-1.484879493713379,
1.4563950300216675,
-0.2282762974500656,
-1.3701139688491821,
-0.23056510090827942,
0.7347081899642944,
-0.17144715785980225,
-0.097585029900074,
-0.9708415269851685,
0.047859810292720795,
-0.7076816558837891,
0.725826144218444... |
javascript/reference/global_objects/arraybuffer/transfertofixedlength/index.md | JavaScript - Global Objects - ArrayBuffer - transferToFixedLength - Examples - Transferring a resizable ArrayBuffer to fixed-length:
Example:
const buffer = new ArrayBuffer(8, { maxByteLength: 16 });
const view = new Uint8Array(buffer);
view[1] = 2;
view[7] = 4;
const buffer2 = buffer.transferToFixedLength();
consol... | [
0.316979318857193,
0.06372855603694916,
-0.6477140784263611,
0.6637674570083618,
0.2711726129055023,
-0.7594266533851624,
0.34852203726768494,
0.21293649077415466,
-0.034179702401161194,
-0.23473896086215973,
-0.3695286214351654,
0.2535083591938019,
-0.5633313059806824,
0.37445539236068726... |
javascript/reference/global_objects/arraybuffer/symbol.species/index.md | JavaScript - Global Objects - ArrayBuffer - Symbol.species:
The `ArrayBuffer[Symbol.species]` static accessor property returns the constructor used to construct return values from array buffer methods.
Warning: The existence of `[Symbol.species]` allows execution of arbitrary code and may create security vulnerabilit... | [
-1.125251293182373,
-0.7585452198982239,
-1.5775384902954102,
0.8387690186500549,
-0.9276396036148071,
-2.033339262008667,
1.1938931941986084,
1.1729309558868408,
-0.04837609827518463,
0.3539610207080841,
-0.9760116934776306,
0.4555901288986206,
-0.1266467571258545,
0.3694716691970825,
0... |
javascript/reference/global_objects/arraybuffer/symbol.species/index.md | JavaScript - Global Objects - ArrayBuffer - Symbol.species - Syntax:
Example:
ArrayBuffer[Symbol.species] | [
-0.15928734838962555,
-0.11163379997015,
-1.5169672966003418,
-0.1093742698431015,
-1.2854288816452026,
-2.3517043590545654,
0.15708395838737488,
1.4407271146774292,
0.40882882475852966,
-0.5436610579490662,
-0.5476687550544739,
0.5658193230628967,
-0.1441563218832016,
0.423683762550354,
... |
javascript/reference/global_objects/arraybuffer/symbol.species/index.md | JavaScript - Global Objects - ArrayBuffer - Symbol.species - Syntax - Return value:
The value of the constructor (`this`) on which `get [Symbol.species]` was called. The return value is used to construct return values from array buffer methods that create new array buffers. | [
-0.7803013920783997,
0.004951810464262962,
-1.273610234260559,
0.5846596956253052,
-0.8202638626098633,
-2.0939462184906006,
0.43090274930000305,
1.4519329071044922,
0.05984838306903839,
0.13403581082820892,
-0.8647848963737488,
1.0055036544799805,
-0.219492107629776,
1.0479553937911987,
... |
javascript/reference/global_objects/arraybuffer/symbol.species/index.md | JavaScript - Global Objects - ArrayBuffer - Symbol.species - Description:
The `[Symbol.species]` accessor property returns the default constructor for `ArrayBuffer` objects. Subclass constructors may override it to change the constructor assignment. The default implementation is basically:
Example:
// Hypothetical u... | [
-0.7463738918304443,
-0.8940186500549316,
-1.7429440021514893,
0.6500590443611145,
-0.5752060413360596,
-1.5832836627960205,
0.8061502575874329,
0.8843517899513245,
0.3743726909160614,
0.03837136551737785,
-0.7181894779205322,
0.3886871337890625,
-0.3667854070663452,
0.5196014642715454,
... |
javascript/reference/global_objects/arraybuffer/symbol.species/index.md | JavaScript - Global Objects - ArrayBuffer - Symbol.species - Examples - Species in ordinary objects:
The `[Symbol.species]` property returns the default constructor function, which is the `ArrayBuffer` constructor for `ArrayBuffer`.
Example:
ArrayBuffer[Symbol.species]; // function ArrayBuffer() | [
-0.6330621242523193,
-0.008170167915523052,
-1.9585458040237427,
0.47243914008140564,
-0.7762950658798218,
-2.0823867321014404,
0.07179594039916992,
1.0419375896453857,
-0.19069939851760864,
-0.2102666050195694,
-0.5968004465103149,
0.5147579908370972,
-0.18043199181556702,
0.2253684401512... |
javascript/reference/global_objects/arraybuffer/symbol.species/index.md | JavaScript - Global Objects - ArrayBuffer - Symbol.species - Examples - Species in derived objects:
In an instance of a custom `ArrayBuffer` subclass, such as `MyArrayBuffer`, the `MyArrayBuffer` species is the `MyArrayBuffer` constructor. However, you might want to overwrite this, in order to return parent `ArrayBuff... | [
-0.7157895565032959,
-0.5731102824211121,
-1.431132435798645,
1.030170202255249,
-0.46935614943504333,
-1.9484684467315674,
0.22100499272346497,
0.6946861147880554,
0.05803202837705612,
-0.000147677244967781,
-0.959304690361023,
0.6534109115600586,
-1.1472126245498657,
0.3918013274669647,
... |
javascript/reference/global_objects/arraybuffer/resize/index.md | JavaScript - Global Objects - ArrayBuffer - resize:
The `resize()` method of `ArrayBuffer` instances resizes the `ArrayBuffer` to the specified size, in bytes.
Example:
const buffer = new ArrayBuffer(8, { maxByteLength: 16 });
console.log(buffer.byteLength);
// Expected output: 8
buffer.resize(12);
console.log(bu... | [
0.08562478423118591,
-0.48872968554496765,
-1.4620776176452637,
0.14007501304149628,
-0.6741212606430054,
-1.497024655342102,
0.32051533460617065,
0.32422399520874023,
0.33880528807640076,
-0.06465961784124374,
-1.0319557189941406,
0.3772326707839966,
-0.5303437113761902,
0.456190526485443... |
javascript/reference/global_objects/arraybuffer/resize/index.md | JavaScript - Global Objects - ArrayBuffer - resize - Syntax:
Example:
resize(newLength) | [
-0.41530826687812805,
0.0878419280052185,
-1.13224196434021,
-0.1962203085422516,
-1.0132883787155151,
-1.7041537761688232,
0.6786609292030334,
0.8143996000289917,
-0.0022623878903687,
-0.4279094636440277,
-1.0467500686645508,
0.19160744547843933,
-0.42485833168029785,
0.4724871814250946,
... |
javascript/reference/global_objects/arraybuffer/resize/index.md | JavaScript - Global Objects - ArrayBuffer - resize - Syntax - Parameters:
- `newLength`: The new length, in bytes, to resize the `ArrayBuffer` to. | [
0.008269616402685642,
0.10692767798900604,
-1.4746297597885132,
-0.11977902799844742,
-0.6505259275436401,
-1.856641411781311,
0.2841411232948303,
0.45199522376060486,
0.39029237627983093,
-0.5044565200805664,
-1.5656651258468628,
0.0632418543100357,
-0.1723206490278244,
0.5253316760063171... |
javascript/reference/global_objects/arraybuffer/resize/index.md | JavaScript - Global Objects - ArrayBuffer - resize - Syntax - Return value:
None (`undefined`). | [
-0.5509272813796997,
0.4490484595298767,
-1.1832971572875977,
-0.4762209355831146,
-0.9939622282981873,
-1.1449284553527832,
1.219022512435913,
1.0672636032104492,
-0.406800240278244,
0.28135329484939575,
-0.6550501585006714,
0.03967669978737831,
-0.2760021388530731,
0.5630320906639099,
... |
javascript/reference/global_objects/arraybuffer/resize/index.md | JavaScript - Global Objects - ArrayBuffer - resize - Syntax - Exceptions:
- `TypeError`: Thrown if the `ArrayBuffer` is detached or is not resizable.
- `RangeError`: Thrown if `newLength` is larger than the `maxByteLength` of the `ArrayBuffer`. | [
-0.04060870781540871,
-0.008712115697562695,
-1.0020869970321655,
0.8814043402671814,
-0.5195400714874268,
-1.7966804504394531,
0.11795030534267426,
1.1061240434646606,
-0.22177556157112122,
0.17397060990333557,
-0.9171209931373596,
-0.2933137118816376,
-0.6095530390739441,
0.2332303375005... |
javascript/reference/global_objects/arraybuffer/resize/index.md | JavaScript - Global Objects - ArrayBuffer - resize - Description:
The `resize()` method resizes an `ArrayBuffer` to the size specified by the `newLength` parameter, provided that the `ArrayBuffer` is resizable and the new size is less than or equal to the `maxByteLength` of the `ArrayBuffer`. New bytes are initialized... | [
-0.5007840394973755,
0.19871722161769867,
-1.549237608909607,
0.549592912197113,
-0.2818526029586792,
-1.4897068738937378,
1.0693784952163696,
0.3074885308742523,
0.030652696266770363,
0.16959542036056519,
-1.353698968887329,
-0.05442305654287338,
-0.4471808969974518,
0.26932916045188904,
... |
javascript/reference/global_objects/arraybuffer/resize/index.md | JavaScript - Global Objects - ArrayBuffer - resize - Examples - Using resize():
In this example, we create a 8-byte buffer that is resizable to a max length of 16 bytes, then check its `resizable` property, resizing it if `resizable` returns `true`:
Example:
const buffer = new ArrayBuffer(8, { maxByteLength: 16 });
... | [
-0.40965887904167175,
0.323067843914032,
-0.9252423048019409,
0.19601374864578247,
-0.7672231793403625,
-1.3052148818969727,
0.6625453233718872,
0.4282783269882202,
0.2548443078994751,
-0.1170281171798706,
-0.9486589431762695,
0.6854130625724792,
-0.3717523217201233,
0.2051624059677124,
... |
javascript/reference/global_objects/arraybuffer/resizable/index.md | JavaScript - Global Objects - ArrayBuffer - resizable:
The `resizable` accessor property of `ArrayBuffer` instances returns whether this array buffer can be resized or not.
Example:
const buffer1 = new ArrayBuffer(8, { maxByteLength: 16 });
const buffer2 = new ArrayBuffer(8);
console.log(buffer1.resizable);
// Expe... | [
-0.22453084588050842,
-0.26146623492240906,
-1.0787672996520996,
0.8500567674636841,
-0.6426777839660645,
-1.5721895694732666,
0.014566459693014622,
0.7015567421913147,
0.7312637567520142,
0.048659224063158035,
-1.271063208580017,
0.15900391340255737,
-0.25684407353401184,
0.85429376363754... |
javascript/reference/global_objects/arraybuffer/resizable/index.md | JavaScript - Global Objects - ArrayBuffer - resizable - Description:
The `resizable` property is an accessor property whose set accessor function is `undefined`, meaning that you can only read this property. The value is established when the array is constructed. If the `maxByteLength` option was set in the constructo... | [
-0.8042471408843994,
0.47733327746391296,
-0.6923770308494568,
1.0364359617233276,
-0.10513990372419357,
-1.239917278289795,
0.748955249786377,
0.8751991391181946,
0.30156710743904114,
0.46603113412857056,
-0.8098520040512085,
-0.006087772082537413,
-0.17770396173000336,
0.7075483202934265... |
javascript/reference/global_objects/arraybuffer/resizable/index.md | JavaScript - Global Objects - ArrayBuffer - resizable - Examples - Using resizable:
In this example, we create a 8-byte buffer that is resizable to a max length of 16 bytes, then check its `resizable` property, resizing it if `resizable` returns `true`:
Example:
const buffer = new ArrayBuffer(8, { maxByteLength: 16 ... | [
-0.36477741599082947,
0.21004006266593933,
-0.9365087151527405,
0.3443681001663208,
-0.7234680652618408,
-1.3040916919708252,
0.6943979263305664,
0.3359530568122864,
0.3336801528930664,
-0.06362203508615494,
-1.0073860883712769,
0.6505582332611084,
-0.30592551827430725,
0.3378153145313263,... |
javascript/reference/global_objects/arraybuffer/bytelength/index.md | JavaScript - Global Objects - ArrayBuffer - byteLength:
The `byteLength` accessor property of `ArrayBuffer` instances returns the length (in bytes) of this array buffer.
Example:
// Create an ArrayBuffer with a size in bytes
const buffer = new ArrayBuffer(8);
// Use byteLength to check the size
const bytes = buffer... | [
-0.1886417269706726,
-0.6984252333641052,
-1.4708166122436523,
0.6065448522567749,
-0.25578081607818604,
-1.5655473470687866,
-0.25139105319976807,
0.1361914426088333,
0.48327505588531494,
-0.22161610424518585,
-1.2335777282714844,
0.20095694065093994,
-0.20985622704029083,
0.2967322766780... |
javascript/reference/global_objects/arraybuffer/bytelength/index.md | JavaScript - Global Objects - ArrayBuffer - byteLength - Description:
The `byteLength` property is an accessor property whose set accessor function is `undefined`, meaning that you can only read this property. The value is established when the array is constructed and cannot be changed. This property returns 0 if this... | [
-0.7311875820159912,
-0.1679607778787613,
-1.1309243440628052,
0.7635627388954163,
0.19338224828243256,
-1.921204924583435,
0.2606111764907837,
1.091658592224121,
0.29465195536613464,
-0.3062342703342438,
-0.5535871982574463,
-0.07627949863672256,
-0.3317170739173889,
-0.05302509292960167,... |
javascript/reference/global_objects/arraybuffer/bytelength/index.md | JavaScript - Global Objects - ArrayBuffer - byteLength - Examples - Using byteLength:
Example:
const buffer = new ArrayBuffer(8);
buffer.byteLength; // 8 | [
-0.14479753375053406,
-0.4656340181827545,
-1.4040031433105469,
0.30713561177253723,
-0.6495959758758545,
-1.6314820051193237,
-0.1268114298582077,
0.5124292373657227,
0.2603665590286255,
-0.4537845551967621,
-1.1487090587615967,
0.06136792525649071,
-0.2365557998418808,
-0.044238027185201... |
javascript/reference/global_objects/arraybuffer/arraybuffer/index.md | JavaScript - Global Objects - ArrayBuffer:
The `ArrayBuffer()` constructor creates `ArrayBuffer` objects.
Example:
// Create an ArrayBuffer with a size in bytes
const buffer = new ArrayBuffer(8);
console.log(buffer.byteLength);
// Expected output: 8 | [
0.0944976955652237,
-0.23127883672714233,
-1.6050893068313599,
0.6815981268882751,
-0.4048616886138916,
-1.5805752277374268,
-0.6263437271118164,
0.7459540367126465,
0.5450512170791626,
-0.1557970941066742,
-0.9343500137329102,
-0.00863497331738472,
-0.43131089210510254,
-0.110725082457065... |
javascript/reference/global_objects/arraybuffer/arraybuffer/index.md | JavaScript - Global Objects - ArrayBuffer - Syntax:
Example:
new ArrayBuffer(length)
new ArrayBuffer(length, options)
Note: `ArrayBuffer()` can only be constructed with `new`. Attempting to call it without `new` throws a `TypeError`. | [
-0.26641175150871277,
0.18402604758739471,
-0.9337138533592224,
0.7072774171829224,
-0.7930548191070557,
-2.1010348796844482,
-0.12818817794322968,
1.2754288911819458,
0.12927284836769104,
-0.30270734429359436,
-0.3974365293979645,
-0.0951504334807396,
0.3977489769458771,
0.014070932753384... |
javascript/reference/global_objects/arraybuffer/arraybuffer/index.md | JavaScript - Global Objects - ArrayBuffer - Syntax - Parameters:
- `length`: The size, in bytes, of the array buffer to create.
- `options` (optional): An object, which can contain the following properties:
- `maxByteLength` (optional): The maximum size, in bytes, that the array buffer can be resized to. | [
-0.08535389602184296,
-0.1374283879995346,
-1.0747346878051758,
0.5859808325767517,
-0.6526564955711365,
-1.9624696969985962,
0.3788115978240967,
0.2645792067050934,
0.4059833586215973,
-0.1615303009748459,
-1.4490694999694824,
0.3597664535045624,
-0.26480478048324585,
0.36049380898475647,... |
javascript/reference/global_objects/arraybuffer/arraybuffer/index.md | JavaScript - Global Objects - ArrayBuffer - Syntax - Return value:
A new `ArrayBuffer` object of the specified size, with its `maxByteLength` property set to the specified `maxByteLength` if one was specified. Its contents are initialized to 0. | [
-0.011821978725492954,
-0.17099528014659882,
-1.1643736362457275,
0.8329122066497803,
-0.6463196873664856,
-1.419913649559021,
0.6804217100143433,
0.9728678464889526,
0.2554580271244049,
0.1859627068042755,
-0.8878318667411804,
0.37913239002227783,
-0.12744519114494324,
0.8648551106452942,... |
javascript/reference/global_objects/arraybuffer/arraybuffer/index.md | JavaScript - Global Objects - ArrayBuffer - Syntax - Exceptions:
- `RangeError`: Thrown in one of the following cases:
- `length` or `maxByteLength` is larger than `Number.MAX_SAFE_INTEGER` (≥ 253) or negative.
- `length` is larger than `maxByteLength`. | [
-0.6278427243232727,
-0.4413728713989258,
-1.000220537185669,
0.2874816954135895,
-0.369185209274292,
-1.797696828842163,
-0.2533339560031891,
0.5718679428100586,
-0.5478339791297913,
-0.06468147039413452,
-0.9150696396827698,
-0.07165354490280151,
-0.7449056506156921,
-0.2178104817867279,... |
javascript/reference/global_objects/arraybuffer/arraybuffer/index.md | JavaScript - Global Objects - ArrayBuffer - Examples - Creating an ArrayBuffer:
In this example, we create a 8-byte buffer with an `Int32Array` view referring to the buffer:
Example:
const buffer = new ArrayBuffer(8);
const view = new Int32Array(buffer); | [
0.3821255564689636,
0.03363347798585892,
-1.1021833419799805,
0.9242686033248901,
-0.3028046488761902,
-1.4691466093063354,
-0.22991332411766052,
0.9981175661087036,
0.809965968132019,
-0.20292775332927704,
-0.2638853192329407,
0.1713094413280487,
-0.10700333118438721,
0.1976800411939621,
... |
javascript/reference/global_objects/arraybuffer/arraybuffer/index.md | JavaScript - Global Objects - ArrayBuffer - Examples - Creating a resizable ArrayBuffer:
In this example, we create a 8-byte buffer that is resizable to a max length of 16 bytes, then `resize()` it to 12 bytes:
Example:
const buffer = new ArrayBuffer(8, { maxByteLength: 16 });
buffer.resize(12);
Note: It is recomm... | [
-0.11811098456382751,
0.1076866090297699,
-1.1039423942565918,
0.43770527839660645,
-0.5482285618782043,
-1.2121742963790894,
0.4757574498653412,
0.5152985453605652,
0.4299386739730835,
-0.2808678150177002,
-0.891416609287262,
0.627112865447998,
-0.4597465395927429,
0.007925603538751602,
... |
javascript/reference/global_objects/arraybuffer/isview/index.md | JavaScript - Global Objects - ArrayBuffer - isView:
The `ArrayBuffer.isView()` static method determines whether the passed value is one of the `ArrayBuffer` views, such as typed array objects or a `DataView`.
Example:
// Create an ArrayBuffer with a size in bytes
const buffer = new ArrayBuffer(16);
console.log(Arra... | [
-0.1855228990316391,
-0.7638856768608093,
-1.0363901853561401,
0.7896708846092224,
-0.5529670119285583,
-1.2210571765899658,
0.49820011854171753,
0.5017669796943665,
0.6390111446380615,
0.28010645508766174,
-1.011800765991211,
-0.705392599105835,
0.9927312135696411,
0.5271100401878357,
-... |
javascript/reference/global_objects/arraybuffer/isview/index.md | JavaScript - Global Objects - ArrayBuffer - isView - Syntax:
Example:
ArrayBuffer.isView(value) | [
-0.0670820102095604,
0.05708988755941391,
-0.801702082157135,
0.006051891949027777,
-1.2151445150375366,
-1.6425164937973022,
0.654258131980896,
0.9085239171981812,
0.4035264551639557,
-0.33669808506965637,
-0.8824568390846252,
-0.25433099269866943,
0.5740389823913574,
0.5497278571128845,
... |
javascript/reference/global_objects/arraybuffer/isview/index.md | JavaScript - Global Objects - ArrayBuffer - isView - Syntax - Parameters:
- `value`: The value to be checked. | [
0.2633337676525116,
0.14830957353115082,
-1.068083643913269,
-0.420830637216568,
-0.661268949508667,
-1.6389023065567017,
1.0270285606384277,
0.8991800546646118,
0.2210746854543686,
-0.1185297742486,
-0.9535844922065735,
-0.14347349107265472,
0.39475712180137634,
0.9872633814811707,
0.32... |
javascript/reference/global_objects/arraybuffer/isview/index.md | JavaScript - Global Objects - ArrayBuffer - isView - Syntax - Return value:
`true` if the given argument is one of the `ArrayBuffer` views; otherwise, `false`. | [
-0.2664315700531006,
-0.3099784851074219,
-0.6714732646942139,
0.29661262035369873,
-1.09639310836792,
-2.0460736751556396,
0.9584346413612366,
0.870760977268219,
0.09785541892051697,
0.21860982477664948,
-1.12977933883667,
-0.9819898009300232,
0.8814268112182617,
0.7811187505722046,
0.0... |
javascript/reference/global_objects/arraybuffer/isview/index.md | JavaScript - Global Objects - ArrayBuffer - isView - Examples - Using isView:
Example:
ArrayBuffer.isView(); // false
ArrayBuffer.isView([]); // false
ArrayBuffer.isView({}); // false
ArrayBuffer.isView(null); // false
ArrayBuffer.isView(undefined); // false
ArrayBuffer.isView(new ArrayBuffer(10)); // false
ArrayBuf... | [
-0.5290407538414001,
-0.2507476806640625,
-0.7379127144813538,
-0.07171948999166489,
-0.7927243709564209,
-1.2134021520614624,
0.6795002222061157,
0.4730786681175232,
0.557623565196991,
0.3437165915966034,
-1.008203387260437,
-0.5929054617881775,
0.8098320960998535,
0.651081383228302,
-0... |
javascript/reference/global_objects/arraybuffer/transfer/index.md | JavaScript - Global Objects - ArrayBuffer - transfer:
The `transfer()` method of `ArrayBuffer` instances creates a new `ArrayBuffer` with the same byte content as this buffer, then detaches this buffer. | [
0.462825208902359,
-0.2642890214920044,
-1.2670834064483643,
1.4395520687103271,
-0.2044389247894287,
-1.2994886636734009,
0.5980689525604248,
1.061018705368042,
0.31207969784736633,
-0.16447433829307556,
-0.9934518337249756,
-0.047368694096803665,
-0.5190477967262268,
0.9398102760314941,
... |
javascript/reference/global_objects/arraybuffer/transfer/index.md | JavaScript - Global Objects - ArrayBuffer - transfer - Syntax:
Example:
transfer()
transfer(newByteLength) | [
-0.4114701449871063,
0.10369864106178284,
-1.2786668539047241,
0.6426932215690613,
-0.681016206741333,
-1.4585480690002441,
0.0022259934339672327,
0.8978551626205444,
0.23873282968997955,
-0.8358618021011353,
-0.7519922256469727,
0.5225851535797119,
-0.011293825693428516,
0.626516699790954... |
javascript/reference/global_objects/arraybuffer/transfer/index.md | JavaScript - Global Objects - ArrayBuffer - transfer - Syntax - Parameters:
- `newByteLength` (optional): The `byteLength` of the new `ArrayBuffer`. Defaults to the `byteLength` of this `ArrayBuffer`.
- If `newByteLength` is smaller than the `byteLength` of this `ArrayBuffer`, the "overflowing" bytes are dropped.
... | [
-0.4623006284236908,
-0.40429919958114624,
-1.7720710039138794,
0.8435085415840149,
-0.1806413233280182,
-2.1284449100494385,
0.5230197310447693,
0.5937213897705078,
0.39780348539352417,
-0.34706637263298035,
-1.2120150327682495,
0.12868686020374298,
0.0253883246332407,
0.7695293426513672,... |
javascript/reference/global_objects/arraybuffer/transfer/index.md | JavaScript - Global Objects - ArrayBuffer - transfer - Syntax - Return value:
A new `ArrayBuffer` object. Its contents are initialized to the contents of this `ArrayBuffer`, and extra bytes, if any, are filled with zeros. The new `ArrayBuffer` is resizable if and only if this `ArrayBuffer` is resizable, in which case ... | [
-0.024505427107214928,
-0.13850149512290955,
-1.0908489227294922,
1.25149667263031,
-0.43189680576324463,
-1.1927497386932373,
0.878365159034729,
1.1305924654006958,
0.43453171849250793,
0.42349720001220703,
-1.065401554107666,
0.15167632699012756,
-0.4165009558200836,
1.3623366355895996,
... |
javascript/reference/global_objects/arraybuffer/transfer/index.md | JavaScript - Global Objects - ArrayBuffer - transfer - Syntax - Exceptions:
- `RangeError`: Thrown if this `ArrayBuffer` is resizable and `newByteLength` is greater than the `maxByteLength` of this `ArrayBuffer`.
- `TypeError`: Thrown if this `ArrayBuffer` is already detached, or if it can only be detached by designat... | [
0.06820578873157501,
0.019196253269910812,
-0.42927899956703186,
1.4519556760787964,
0.07042183727025986,
-1.006919503211975,
0.20346930623054504,
1.3991608619689941,
-0.28800806403160095,
0.3672138750553131,
-0.8715099692344666,
0.30497148633003235,
-0.06088554114103317,
0.532716929912567... |
javascript/reference/global_objects/arraybuffer/transfer/index.md | JavaScript - Global Objects - ArrayBuffer - transfer - Description:
The `transfer()` method performs the same operation as the structured clone algorithm. It copies the bytes of this `ArrayBuffer` into a new `ArrayBuffer` object, then detaches this `ArrayBuffer` object. See transferring ArrayBuffers for more informati... | [
-0.22350986301898956,
0.28620395064353943,
-1.328047513961792,
1.6421781778335571,
0.47974416613578796,
-0.662056565284729,
0.618273138999939,
1.1147414445877075,
-0.1669856458902359,
0.6373762488365173,
-0.8530033230781555,
0.3080659806728363,
0.37059441208839417,
1.138012170791626,
-0.... |
javascript/reference/global_objects/arraybuffer/transfer/index.md | JavaScript - Global Objects - ArrayBuffer - transfer - Examples - Transferring an ArrayBuffer:
Example:
// Create an ArrayBuffer and write a few bytes
const buffer = new ArrayBuffer(8);
const view = new Uint8Array(buffer);
view[1] = 2;
view[7] = 4;
// Copy the buffer to the same size
const buffer2 = buffer.transfer(... | [
0.12835834920406342,
0.2248133420944214,
-1.322712779045105,
0.8098247051239014,
-0.18230928480625153,
-1.2452658414840698,
-0.19553199410438538,
0.6874802708625793,
0.4585650563240051,
-0.1001836508512497,
-0.3884147107601166,
0.1433083415031433,
0.08521740883588791,
0.8955200910568237,
... |
javascript/reference/global_objects/arraybuffer/transfer/index.md | JavaScript - Global Objects - ArrayBuffer - transfer - Examples - Transferring a resizable ArrayBuffer:
Example:
const buffer = new ArrayBuffer(8, { maxByteLength: 16 });
const view = new Uint8Array(buffer);
view[1] = 2;
view[7] = 4;
// Copy the buffer to a smaller size
const buffer2 = buffer.transfer(4);
console.lo... | [
-0.14108234643936157,
0.13010390102863312,
-1.1884809732437134,
0.6898225545883179,
-0.47330206632614136,
-0.8652568459510803,
-0.3972040116786957,
0.23070630431175232,
0.3795371651649475,
-0.09684189409017563,
-0.44703978300094604,
0.6844960451126099,
0.10524094104766846,
0.97915434837341... |
javascript/reference/global_objects/arraybuffer/slice/index.md | JavaScript - Global Objects - ArrayBuffer - slice:
The `slice()` method of `ArrayBuffer` instances returns a new `ArrayBuffer` whose contents are a copy of this `ArrayBuffer`'s bytes from `start`, inclusive, up to `end`, exclusive. If either `start` or `end` is negative, it refers to an index from the end of the array... | [
-0.7657424807548523,
-0.36811158061027527,
-0.981519341468811,
0.6364699602127075,
0.3883597254753113,
-0.5291693210601807,
-0.09098907560110092,
0.150907963514328,
0.16216135025024414,
0.6270559430122375,
-0.3840242326259613,
0.5000612735748291,
-0.010968690738081932,
0.6182413697242737,
... |
javascript/reference/global_objects/arraybuffer/slice/index.md | JavaScript - Global Objects - ArrayBuffer - slice - Syntax:
Example:
slice()
slice(start)
slice(start, end) | [
-0.41197022795677185,
0.5508705973625183,
-0.806542158126831,
-0.12865445017814636,
-0.6930887699127197,
-0.669214129447937,
0.3218349814414978,
0.8345474600791931,
-0.10353585332632065,
-0.06231536343693733,
-0.004134666174650192,
0.19509251415729523,
-0.4004342555999756,
0.41964983940124... |
javascript/reference/global_objects/arraybuffer/slice/index.md | JavaScript - Global Objects - ArrayBuffer - slice - Syntax - Parameters:
- `start` (optional): Zero-based index at which to start extraction, converted to an integer.
- Negative index counts back from the end of the buffer — if `-buffer.length <= start < 0`, `start + buffer.length` is used.
- If `start < -buffer.l... | [
-0.6690972447395325,
0.252557635307312,
-1.097537636756897,
0.6279142498970032,
0.09782391786575317,
-1.285636067390442,
0.7452073097229004,
0.3247077763080597,
0.13563960790634155,
0.6407795548439026,
-1.1452194452285767,
0.12940673530101776,
-0.07616373896598816,
0.7846935391426086,
1.... |
javascript/reference/global_objects/arraybuffer/slice/index.md | JavaScript - Global Objects - ArrayBuffer - slice - Syntax - Return value:
A new `ArrayBuffer` containing the extracted elements. It is not resizable, even if the original was. | [
-0.2475574016571045,
0.36975613236427307,
-1.4082380533218384,
0.46629950404167175,
-0.4140515923500061,
-1.4389643669128418,
0.5512797832489014,
1.2264463901519775,
-0.11996850371360779,
0.6246060132980347,
-0.7495390176773071,
-0.018817581236362457,
-0.5115006566047668,
1.142849802970886... |
javascript/reference/global_objects/arraybuffer/slice/index.md | JavaScript - Global Objects - ArrayBuffer - slice - Examples - Copying an ArrayBuffer:
Example:
const buf1 = new ArrayBuffer(8);
const buf2 = buf1.slice(0); | [
-0.9631382822990417,
0.334368497133255,
-0.8002213835716248,
0.5883662700653076,
-0.1655620038509369,
-1.2000725269317627,
0.15849050879478455,
0.43061789870262146,
0.30498993396759033,
-0.017093678936362267,
-0.9837887287139893,
-0.1608106642961502,
-0.2522277235984802,
0.3239047527313232... |
javascript/reference/global_objects/arraybuffer/maxbytelength/index.md | JavaScript - Global Objects - ArrayBuffer - maxByteLength:
The `maxByteLength` accessor property of `ArrayBuffer` instances returns the maximum length (in bytes) that this array buffer can be resized to.
Example:
const buffer = new ArrayBuffer(8, { maxByteLength: 16 });
console.log(buffer.byteLength);
// Expected o... | [
-0.18939536809921265,
-0.8030007481575012,
-1.478362798690796,
0.7166653871536255,
-0.5908358097076416,
-1.5314571857452393,
-0.450412780046463,
0.22173064947128296,
0.8699314594268799,
-0.10452782362699509,
-1.160127878189087,
0.46129727363586426,
-0.5570599436759949,
0.5789836645126343,
... |
javascript/reference/global_objects/arraybuffer/maxbytelength/index.md | JavaScript - Global Objects - ArrayBuffer - maxByteLength - Description:
The `maxByteLength` property is an accessor property whose set accessor function is `undefined`, meaning that you can only read this property. The value is established when the array is constructed, set via the `maxByteLength` option of the `Arra... | [
-0.7971346974372864,
-0.4460861086845398,
-1.2017520666122437,
0.9234227538108826,
0.015835704281926155,
-1.3175562620162964,
0.3015749454498291,
0.6516678333282471,
0.5884687900543213,
-0.13840311765670776,
-0.6377978324890137,
0.11677096784114838,
-0.6849759817123413,
0.1699102371931076,... |
javascript/reference/global_objects/arraybuffer/maxbytelength/index.md | JavaScript - Global Objects - ArrayBuffer - maxByteLength - Examples - Using maxByteLength:
In this example, we create an 8-byte buffer that is resizable to a max length of 16 bytes, then return its `maxByteLength`:
Example:
const buffer = new ArrayBuffer(8, { maxByteLength: 16 });
buffer.maxByteLength; // 16 | [
-0.5001354813575745,
-0.23906706273555756,
-1.0109503269195557,
0.518919050693512,
-0.5323725938796997,
-1.264357566833496,
0.3049219846725464,
0.16057351231575012,
0.48168525099754333,
-0.4123539924621582,
-1.026388168334961,
0.8496814966201782,
-0.23280999064445496,
-0.0681660994887352,
... |
javascript/reference/global_objects/arraybuffer/detached/index.md | JavaScript - Global Objects - ArrayBuffer - detached:
The `detached` accessor property of `ArrayBuffer` instances returns a boolean indicating whether or not this buffer has been detached (transferred). | [
0.21171215176582336,
-0.5284417271614075,
-1.6653982400894165,
1.033089280128479,
-0.9331727027893066,
-2.0857203006744385,
1.2179601192474365,
0.8622546195983887,
0.13399209082126617,
0.4203300476074219,
-1.0536006689071655,
-0.3157651424407959,
-0.5742945671081543,
1.0471265316009521,
... |
javascript/reference/global_objects/arraybuffer/detached/index.md | JavaScript - Global Objects - ArrayBuffer - detached - Description:
The `detached` property is an accessor property whose set accessor function is `undefined`, meaning that you can only read this property. The value is `false` when the `ArrayBuffer` is first created. The value becomes `true` if the `ArrayBuffer` is tr... | [
0.2569248378276825,
-0.031470995396375656,
-1.3001182079315186,
0.6030912399291992,
-0.6317198276519775,
-2.224350690841675,
1.1913574934005737,
0.9141462445259094,
0.8674904108047485,
0.3437509536743164,
-0.5614601969718933,
-0.6613403558731079,
-0.8397545218467712,
0.578666090965271,
0... |
javascript/reference/global_objects/arraybuffer/detached/index.md | JavaScript - Global Objects - ArrayBuffer - detached - Examples - Using detached:
Example:
const buffer = new ArrayBuffer(8);
console.log(buffer.detached); // false
const newBuffer = buffer.transfer();
console.log(buffer.detached); // true
console.log(newBuffer.detached); // false | [
0.5556880235671997,
-0.12274874001741409,
-1.3074555397033691,
0.23300117254257202,
-0.758169412612915,
-2.054727077484131,
0.6846344470977783,
0.7717753648757935,
0.3390949070453644,
0.19732534885406494,
-0.5456146597862244,
0.17605844140052795,
-0.46479111909866333,
0.38736775517463684,
... |
javascript/reference/global_objects/boolean/index.md | JavaScript - Global Objects - Boolean:
`Boolean` values can be one of two values: `true` or `false`, representing the truth value of a logical proposition. | [
-0.6714357137680054,
-0.03792589157819748,
-0.563089907169342,
-0.19182927906513214,
-0.7360166907310486,
-1.8005719184875488,
0.28520750999450684,
1.100340723991394,
0.3028581738471985,
-0.826705276966095,
-1.1733734607696533,
-0.10149595886468887,
0.6574022173881531,
-0.5769175291061401,... |
javascript/reference/global_objects/boolean/index.md | JavaScript - Global Objects - Boolean - Description:
Boolean values are typically produced by relational operators, equality operators, and logical NOT (`!`). They can also be produced by functions that represent conditions, such as `Array.isArray()`. Note that binary logical operators such as `&&` and `||` return the... | [
-0.8377442359924316,
-0.09325024485588074,
-1.1493076086044312,
0.6198590993881226,
-0.12168289721012115,
-0.9241354465484619,
0.0057101743295788765,
0.7336410284042358,
-0.0022051152773201466,
-0.3279069662094116,
-1.266722321510315,
-0.19411547482013702,
1.2359434366226196,
-0.3137371242... |
javascript/reference/global_objects/boolean/index.md | JavaScript - Global Objects - Boolean - Description - Boolean primitives and Boolean objects:
For converting non-boolean values to boolean, use `Boolean` as a function or use the double NOT operator. Do not use the `Boolean()` constructor with `new`.
Example:
const good = Boolean(expression);
const good2 = !!express... | [
-0.7133799195289612,
0.21177296340465546,
-0.968864381313324,
0.7424553036689758,
-0.138514906167984,
-1.6874862909317017,
-0.2656979262828827,
0.5595269799232483,
0.36262497305870056,
0.10496695339679718,
-1.1110424995422363,
0.08907268941402435,
0.8903941512107849,
-0.719292938709259,
... |
javascript/reference/global_objects/boolean/index.md | JavaScript - Global Objects - Boolean - Description - Boolean coercion:
Many built-in operations that expect booleans first coerce their arguments to booleans. The operation can be summarized as follows:
- Booleans are returned as-is.
- `undefined` turns into `false`.
- `null` turns into `false`.
- `0`, `-0`, and `Na... | [
-0.35507291555404663,
-0.04714035615324974,
-0.39656755328178406,
0.7325655221939087,
0.7141854166984558,
-0.4522804021835327,
0.618850827217102,
0.7842819690704346,
-0.40216130018234253,
-0.3445360064506531,
-0.7786574363708496,
-0.20344462990760803,
-0.24402275681495667,
0.32729554176330... |
javascript/reference/global_objects/boolean/index.md | JavaScript - Global Objects - Boolean - Constructor:
- `Boolean()`: Creates `Boolean` objects. When called as a function, it returns primitive values of type Boolean. | [
-0.9445309638977051,
0.32583844661712646,
-1.2512112855911255,
0.04575755447149277,
-0.2338929921388626,
-1.4162399768829346,
0.433259516954422,
1.0548335313796997,
-0.5481842160224915,
-0.2884521484375,
-1.3489022254943848,
0.2415098398923874,
0.4481239914894104,
-0.06716150790452957,
0... |
javascript/reference/global_objects/boolean/index.md | JavaScript - Global Objects - Boolean - Instance properties:
These properties are defined on `Boolean.prototype` and shared by all `Boolean` instances.
- `Boolean.prototype.constructor`: The constructor function that created the instance object. For `Boolean` instances, the initial value is the `Boolean` constructor. | [
-0.1984604001045227,
-0.2754603326320648,
-0.8024013042449951,
0.40987005829811096,
0.008851864375174046,
-1.5984835624694824,
0.045290250331163406,
0.7157300710678101,
0.47430580854415894,
-0.5367035865783691,
-1.347579002380371,
0.37310487031936646,
0.2350713014602661,
0.2928961217403412... |
javascript/reference/global_objects/boolean/index.md | JavaScript - Global Objects - Boolean - Instance methods:
- `Boolean.prototype.toString()`: Returns a string of either `true` or `false` depending upon the value of the object. Overrides the `Object.prototype.toString()` method.
- `Boolean.prototype.valueOf()`: Returns the primitive value of the `Boolean` object. Over... | [
-0.7180958390235901,
-0.5505955815315247,
-0.17683754861354828,
-0.10331717878580093,
-0.14525510370731354,
-1.7330466508865356,
1.077531099319458,
0.32917600870132446,
-0.1531415581703186,
-0.9130364656448364,
-1.3674397468566895,
0.5687465667724609,
0.7443901300430298,
-0.313655406236648... |
javascript/reference/global_objects/boolean/index.md | JavaScript - Global Objects - Boolean - Examples - Creating false values:
Example:
const bNoParam = Boolean();
const bZero = Boolean(0);
const bNull = Boolean(null);
const bEmptyString = Boolean("");
const bfalse = Boolean(false); | [
-0.5443298816680908,
0.22140547633171082,
-0.4562795162200928,
0.6058408617973328,
-0.38557127118110657,
-1.1777931451797485,
0.8395190238952637,
1.3403609991073608,
-0.7159445285797119,
-0.09640265256166458,
-1.0139586925506592,
-0.0068343146704137325,
0.6442789435386658,
-0.7519071698188... |
javascript/reference/global_objects/boolean/index.md | JavaScript - Global Objects - Boolean - Examples - Creating true values:
Example:
const btrue = Boolean(true);
const btrueString = Boolean("true");
const bfalseString = Boolean("false");
const bSuLin = Boolean("Su Lin");
const bArrayProto = Boolean([]);
const bObjProto = Boolean({}); | [
-0.44995149970054626,
-0.0379578061401844,
-0.6757379770278931,
0.34157007932662964,
-0.37367671728134155,
-1.1552330255508423,
0.08395928889513016,
0.6479377150535583,
-0.032774701714515686,
0.10852921009063721,
-0.43597277998924255,
0.5138787031173706,
1.018520474433899,
-0.6005753278732... |
javascript/reference/global_objects/boolean/tostring/index.md | JavaScript - Global Objects - Boolean - toString:
The `toString()` method of `Boolean` values returns a string representing the specified boolean value.
Example:
const flag1 = new Boolean(true);
console.log(flag1.toString());
// Expected output: "true"
const flag2 = new Boolean(1);
console.log(flag2.toString());
... | [
-1.0761116743087769,
-0.00022787008492741734,
-0.9580458402633667,
-0.012752103619277477,
-0.18386656045913696,
-2.5072474479675293,
-0.03316381573677063,
0.4578586518764496,
-0.32891157269477844,
-0.7067090272903442,
-0.6396012902259827,
0.47112590074539185,
0.7185764908790588,
0.13596662... |
javascript/reference/global_objects/boolean/tostring/index.md | JavaScript - Global Objects - Boolean - toString - Syntax:
Example:
toString() | [
-0.940150260925293,
0.3462778627872467,
-0.5287281274795532,
-0.07727914303541183,
-0.47249487042427063,
-2.2165040969848633,
0.4014153480529785,
0.305416077375412,
-0.21328498423099518,
-1.2280961275100708,
-0.42526406049728394,
0.4279605448246002,
0.14177154004573822,
-0.3908531367778778... |
javascript/reference/global_objects/boolean/tostring/index.md | JavaScript - Global Objects - Boolean - toString - Syntax - Parameters:
None. | [
-0.7036259174346924,
0.35590237379074097,
-0.6843363046646118,
-0.5771465301513672,
-0.5117787718772888,
-1.841316819190979,
0.669465184211731,
0.47711774706840515,
-0.2855663001537323,
-1.1760213375091553,
-0.9384866952896118,
-0.35636645555496216,
0.24972648918628693,
-0.1659124791622162... |
javascript/reference/global_objects/boolean/tostring/index.md | JavaScript - Global Objects - Boolean - toString - Syntax - Return value:
A string representing the specified boolean value. | [
-0.6063377261161804,
-0.19329211115837097,
-0.6500995755195618,
-0.1189039871096611,
-0.4980381429195404,
-2.299926519393921,
0.4504457712173462,
0.8266980648040771,
-0.2461964190006256,
-0.6395708918571472,
-0.6178685426712036,
0.9910063743591309,
-0.051952216774225235,
0.7252473831176758... |
javascript/reference/global_objects/boolean/tostring/index.md | JavaScript - Global Objects - Boolean - toString - Description:
The `Boolean` object overrides the `toString` method of `Object`; it does not inherit `Object.prototype.toString()`. For `Boolean` values, the `toString` method returns a string representation of the boolean value, which is either `"true"` or `"false"`.
... | [
0.1275233030319214,
0.09323324263095856,
-0.5388635396957397,
0.6855854988098145,
0.7242669463157654,
-1.1805284023284912,
0.5588963031768799,
0.4606795907020569,
-0.6307656168937683,
-0.5120224952697754,
-0.6321209073066711,
0.24961647391319275,
0.02956836298108101,
0.2756815254688263,
... |
javascript/reference/global_objects/boolean/tostring/index.md | JavaScript - Global Objects - Boolean - toString - Examples - Using toString():
Example:
const flag = new Boolean(true);
console.log(flag.toString()); // "true"
console.log(false.toString()); // "false" | [
-0.49699705839157104,
0.3834879696369171,
-0.6240805983543396,
0.26384422183036804,
-0.4473498463630676,
-2.494973659515381,
0.17413486540317535,
0.15753892064094543,
-0.005530128721147776,
-0.7674229145050049,
-0.41894376277923584,
0.15382836759090424,
0.4026695489883423,
-0.0841721817851... |
javascript/reference/global_objects/boolean/boolean/index.md | JavaScript - Global Objects - Boolean:
The `Boolean()` constructor creates `Boolean` objects. When called as a function, it returns primitive values of type Boolean.
Example:
const flag = new Boolean();
console.log(typeof flag);
// Expected output: object
console.log(flag === false);
// Expected output: false
const... | [
-0.18890051543712616,
0.16979433596134186,
-1.4187852144241333,
0.4580724835395813,
-0.2984394431114197,
-1.8433805704116821,
-0.35755959153175354,
0.992296576499939,
-0.22080710530281067,
-0.23592782020568848,
-0.9532518982887268,
0.22114603221416473,
0.34786421060562134,
-0.2577123939990... |
javascript/reference/global_objects/boolean/boolean/index.md | JavaScript - Global Objects - Boolean - Syntax:
Example:
new Boolean(value)
Boolean(value)
Note: `Boolean()` can be called with or without `new`, but with different effects. See Return value. | [
-0.06416014581918716,
0.5287462472915649,
-0.8352972269058228,
-0.09051872789859772,
-0.5432417988777161,
-1.982374668121338,
0.2094726264476776,
1.430717945098877,
0.08984911441802979,
-0.7496041059494019,
-0.47055497765541077,
0.9759619235992432,
0.47849947214126587,
0.024969588965177536... |
javascript/reference/global_objects/boolean/boolean/index.md | JavaScript - Global Objects - Boolean - Syntax - Parameters:
- `value`: The initial value of the `Boolean` object. | [
0.39826270937919617,
0.6088172793388367,
-1.0063132047653198,
-0.11464744806289673,
-0.40494343638420105,
-1.5852419137954712,
1.2641537189483643,
1.290799617767334,
0.11268636584281921,
-1.0118200778961182,
-0.9598920941352844,
0.36951789259910583,
0.10201370716094971,
0.06497277319431305... |
javascript/reference/global_objects/boolean/boolean/index.md | JavaScript - Global Objects - Boolean - Syntax - Return value:
When `Boolean()` is called as a function (without `new`), it returns `value` coerced to a boolean primitive.
When `Boolean()` is called as a constructor (with `new`), it coerces `value` to a boolean primitive and returns a wrapping `Boolean` object, which... | [
-0.40292298793792725,
0.7490391731262207,
-0.6017217040061951,
0.016013190150260925,
-0.4929502010345459,
-1.5613495111465454,
0.6412563920021057,
1.4885239601135254,
-0.6666868925094604,
0.2273789495229721,
-0.7878347039222717,
0.4030452072620392,
0.17596803605556488,
0.11451593786478043,... |
javascript/reference/global_objects/boolean/boolean/index.md | JavaScript - Global Objects - Boolean - Description:
The value passed as the first parameter is converted to a boolean value. If the value is omitted or is `0`, `-0`, `0n`, `null`, `false`, `NaN`, `undefined`, or the empty string (`""`), then the object has an initial value of `false`. All other values, including any ... | [
-0.24687407910823822,
0.598816454410553,
-0.8499953746795654,
0.9889888763427734,
-0.1718735545873642,
-1.6616542339324951,
1.244761347770691,
0.8039882183074951,
-0.3635406494140625,
-0.3565590977668762,
-0.9613960385322571,
-0.3804137408733368,
0.4387751817703247,
-0.3244781792163849,
... |
javascript/reference/global_objects/boolean/boolean/index.md | JavaScript - Global Objects - Boolean - Examples - Creating Boolean objects with an initial value of false:
Example:
const bZero = new Boolean(0);
const bNull = new Boolean(null);
const bEmptyString = new Boolean("");
const bfalse = new Boolean(false);
typeof bfalse; // "object"
Boolean(bfalse); // true
Note how co... | [
-0.6783966422080994,
0.4745986759662628,
-0.8928287625312805,
0.6589774489402771,
-0.045739561319351196,
-1.262040138244629,
1.4306265115737915,
1.014117956161499,
-0.015821078792214394,
-0.41480857133865356,
-1.1242388486862183,
0.041246600449085236,
0.6875555515289307,
-0.561871051788330... |
javascript/reference/global_objects/boolean/boolean/index.md | JavaScript - Global Objects - Boolean - Examples - Creating `Boolean` objects with an initial value of `true`:
Example:
const btrue = new Boolean(true);
const btrueString = new Boolean("true");
const bfalseString = new Boolean("false");
const bSuLin = new Boolean("Su Lin");
const bArrayProto = new Boolean([]);
const ... | [
-0.30492860078811646,
0.07078465074300766,
-0.6853594779968262,
0.6586346626281738,
-0.264412522315979,
-1.1385512351989746,
0.17901834845542908,
0.671990156173706,
-0.2722463607788086,
-0.16620561480522156,
-0.6538532972335815,
0.017365582287311554,
0.9569266438484192,
-0.4414862096309662... |
javascript/reference/global_objects/boolean/valueof/index.md | JavaScript - Global Objects - Boolean - valueOf:
The `valueOf()` method of `Boolean` values returns the primitive value of a `Boolean` object.
Example:
const x = new Boolean();
console.log(x.valueOf());
// Expected output: false
const y = new Boolean("Mozilla");
console.log(y.valueOf());
// Expected output: true | [
-0.3484286665916443,
-0.366702139377594,
-1.0030200481414795,
-0.0033647585660219193,
-0.025413090363144875,
-0.7732154726982117,
0.4977106750011444,
0.6845451593399048,
0.3900968134403229,
-0.5447144508361816,
-0.7152295708656311,
0.265749454498291,
0.664412796497345,
0.255461186170578,
... |
javascript/reference/global_objects/boolean/valueof/index.md | JavaScript - Global Objects - Boolean - valueOf - Syntax:
Example:
valueOf() | [
0.2747553288936615,
0.05865978077054024,
-0.6238518953323364,
-0.25469642877578735,
-0.4370293915271759,
-1.456207275390625,
0.9209944605827332,
0.9465923309326172,
0.42986980080604553,
-1.2586455345153809,
-0.6856511831283569,
0.6406852006912231,
0.04324876144528389,
0.1595667153596878,
... |
javascript/reference/global_objects/boolean/valueof/index.md | JavaScript - Global Objects - Boolean - valueOf - Syntax - Parameters:
None. | [
0.08215698599815369,
0.4238619804382324,
-1.0353493690490723,
-0.5024629831314087,
-0.5130564570426941,
-1.2955468893051147,
1.0356485843658447,
0.8841894268989563,
0.06343702226877213,
-1.217568278312683,
-1.0295058488845825,
-0.21876168251037598,
0.17088058590888977,
0.1290665715932846,
... |
javascript/reference/global_objects/boolean/valueof/index.md | JavaScript - Global Objects - Boolean - valueOf - Syntax - Return value:
The primitive value of the given `Boolean` object. | [
-0.21459123492240906,
0.2487303912639618,
-0.6037554740905762,
-0.615863025188446,
-0.4501073360443115,
-1.1139771938323975,
1.3172271251678467,
1.1075644493103027,
0.11350300163030624,
-0.6338214874267578,
-1.2335350513458252,
0.8848459720611572,
-0.34353673458099365,
0.957102358341217,
... |
javascript/reference/global_objects/boolean/valueof/index.md | JavaScript - Global Objects - Boolean - valueOf - Description:
The `valueOf()` method of `Boolean` returns the primitive value of a `Boolean` object or literal `Boolean` as a Boolean data type.
This method is usually called internally by JavaScript and not explicitly in code. | [
-0.8318970799446106,
-0.0447089821100235,
-0.9471991658210754,
-0.09704753011465073,
-0.03773529455065727,
-1.0476038455963135,
1.5508837699890137,
0.7775617241859436,
-0.21473057568073273,
-0.5071263313293457,
-1.3027430772781372,
0.8685843348503113,
0.41835322976112366,
0.166201397776603... |
javascript/reference/global_objects/boolean/valueof/index.md | JavaScript - Global Objects - Boolean - valueOf - Examples - Using `valueOf()`:
Example:
const x = new Boolean();
const myVar = x.valueOf(); // assigns false to myVar | [
-0.3735840916633606,
-0.05345030128955841,
-0.7890502214431763,
0.5634777545928955,
-0.543491005897522,
-0.9824805855751038,
0.8793774843215942,
0.5398938059806824,
0.39488497376441956,
-0.836665153503418,
-0.8319792747497559,
-0.03122173622250557,
0.30208197236061096,
0.27430257201194763,... |
javascript/reference/global_objects/undefined/index.md | JavaScript - Global Objects - undefined:
The `undefined` global property represents the primitive value `undefined`. It is one of JavaScript's `primitive types`.
Example:
function test(t) {
if (t === undefined) {
return "Undefined value!";
}
return t;
}
let x;
console.log(test(x));
// Expected output: "U... | [
-1.5765091180801392,
0.346664160490036,
-0.905990719795227,
-0.1713058054447174,
-0.22246100008487701,
-1.5134861469268799,
0.9852015972137451,
0.743059515953064,
-0.309291809797287,
0.04581448808312416,
-0.48524782061576843,
0.028535932302474976,
-0.510539174079895,
-0.31534770131111145,
... |
javascript/reference/global_objects/undefined/index.md | JavaScript - Global Objects - undefined - Value:
The primitive value `undefined`. | [
-0.7084122896194458,
0.4912031888961792,
-0.609473466873169,
-0.9349724054336548,
-0.7655991911888123,
-1.1958693265914917,
1.594638466835022,
1.0194356441497803,
0.2503896653652191,
-0.17794042825698853,
-0.5124577879905701,
-0.5976545214653015,
-0.7582587003707886,
-0.17900295555591583,
... |
javascript/reference/global_objects/undefined/index.md | JavaScript - Global Objects - undefined - Description:
`undefined` is a property of the global object. That is, it is a variable in global scope.
In all non-legacy browsers, `undefined` is a non-configurable, non-writable property. Even when this is not the case, avoid overriding it.
A variable that has not been ass... | [
-1.119726538658142,
0.23734089732170105,
-0.8981544375419617,
0.09707629680633545,
-0.4167962968349457,
-1.4871705770492554,
0.799206554889679,
0.2791972756385803,
0.07726505398750305,
0.11329805850982666,
-0.426842600107193,
-0.05498775094747543,
-0.11607737839221954,
-0.08214204758405685... |
javascript/reference/global_objects/undefined/index.md | JavaScript - Global Objects - undefined - Examples - Strict equality and undefined:
You can use `undefined` and the strict equality and inequality operators to determine whether a variable has a value. In the following code, the variable `x` is not initialized, and the `if` statement evaluates to true.
Example:
let ... | [
-1.2452483177185059,
0.1220797449350357,
-1.0987217426300049,
0.6847331523895264,
-0.09447398036718369,
-0.8563647270202637,
1.6930891275405884,
0.6952161192893982,
0.4208123981952667,
0.40368810296058655,
-0.6973470449447632,
-0.9382978081703186,
-0.05552659183740616,
-0.32743576169013977... |
javascript/reference/global_objects/undefined/index.md | JavaScript - Global Objects - undefined - Examples - typeof operator and undefined:
`typeof` can also determine whether a variable is `undefined`:
Example:
let x;
if (typeof x === "undefined") {
// these statements execute
}
One reason to use `typeof` is that it does not throw an error if the variable does not ex... | [
-0.5030653476715088,
0.008056006394326687,
-0.7198464274406433,
0.983065664768219,
0.3072148859500885,
0.2171662151813507,
-0.050885602831840515,
0.2788139879703522,
-0.012784920632839203,
-0.22900919616222382,
-0.45767608284950256,
-0.18851952254772186,
0.16768845915794373,
0.370279252529... |
javascript/reference/global_objects/undefined/index.md | JavaScript - Global Objects - undefined - Examples - void operator and undefined:
The `void` operator can also be used to produce the `undefined` value. This is very commonly seen in minified code because `void 0` is 3 bytes shorter and cannot be overridden. You should usually avoid this pattern in your own code.
Exa... | [
-1.0272573232650757,
1.0110809803009033,
-1.196123719215393,
0.6169212460517883,
0.5590627193450928,
-0.6872343420982361,
0.5487849116325378,
1.7059365510940552,
-0.12188100814819336,
0.16898834705352783,
-1.1865360736846924,
-0.8988041281700134,
0.5724001526832581,
-0.5718135833740234,
... |
javascript/reference/global_objects/encodeuri/index.md | JavaScript - Global Objects - encodeURI:
The `encodeURI()` function encodes a `URI` by replacing each instance of certain characters by one, two, three, or four escape sequences representing the `UTF-8` encoding of the character (will only be four escape sequences for characters composed of two surrogate characters). ... | [
0.1743166595697403,
-0.2968430519104004,
-0.49877479672431946,
0.12536552548408508,
-0.4166982173919678,
-1.3452080488204956,
-0.27065128087997437,
0.36338263750076294,
-0.38807061314582825,
-0.7423378229141235,
-0.9133846163749695,
-0.1073833554983139,
0.11129521578550339,
-0.206559002399... |
javascript/reference/global_objects/encodeuri/index.md | JavaScript - Global Objects - encodeURI - Syntax:
Example:
encodeURI(uri) | [
0.5962842106819153,
0.49809688329696655,
-0.6350064277648926,
-0.21072286367416382,
-1.5198005437850952,
-1.5327445268630981,
0.03711117431521416,
1.295328140258789,
-0.29807478189468384,
-0.9526280164718628,
-0.7962942719459534,
0.5093103051185608,
0.3392872214317322,
-0.21184828877449036... |
javascript/reference/global_objects/encodeuri/index.md | JavaScript - Global Objects - encodeURI - Syntax - Parameters:
- `uri`: A string to be encoded as a URI. | [
0.6515111923217773,
0.4212386906147003,
-0.6020863056182861,
-0.13404200971126556,
-1.0329784154891968,
-1.675740361213684,
-0.1859540492296219,
1.0965577363967896,
0.3417057991027832,
-0.5894655585289001,
-1.2527252435684204,
0.2653368413448334,
0.2849861681461334,
0.37833306193351746,
... |
javascript/reference/global_objects/encodeuri/index.md | JavaScript - Global Objects - encodeURI - Syntax - Return value:
A new string representing the provided string encoded as a URI. | [
-0.12601812183856964,
-0.17439627647399902,
-0.4760679602622986,
-0.24759835004806519,
-0.9851617217063904,
-1.8881796598434448,
0.13829363882541656,
1.4016103744506836,
0.11244073510169983,
-0.05487514287233353,
-0.8771637082099915,
0.475320428609848,
0.1615275889635086,
1.115523338317871... |
javascript/reference/global_objects/encodeuri/index.md | JavaScript - Global Objects - encodeURI - Syntax - Exceptions:
- `URIError`: Thrown if `uri` contains a lone surrogate. | [
-0.45058736205101013,
1.0022327899932861,
-0.5701727271080017,
0.2213311493396759,
-1.109310269355774,
-1.3617247343063354,
-0.2480155974626541,
1.4169971942901611,
-0.7292593121528625,
-0.5426934957504272,
-0.7073225378990173,
-0.22085322439670563,
0.06051061674952507,
-0.0620769783854484... |
javascript/reference/global_objects/encodeuri/index.md | JavaScript - Global Objects - encodeURI - Description:
`encodeURI()` is a function property of the global object.
The `encodeURI()` function escapes characters by UTF-8 code units, with each octet encoded in the format `%XX`, left-padded with 0 if necessary. Because lone surrogates in UTF-16 do not encode any valid U... | [
-0.2650523781776428,
0.7110541462898254,
-0.07485245913267136,
0.8290442824363708,
0.3932315707206726,
-0.39673978090286255,
-0.46394816040992737,
0.2046406865119934,
-0.2553028166294098,
-0.4836907386779785,
-0.41346409916877747,
0.4155955910682678,
-0.2826831340789795,
0.5901850461959839... |
javascript/reference/global_objects/encodeuri/index.md | JavaScript - Global Objects - encodeURI - Examples - encodeURI() vs. encodeURIComponent():
`encodeURI()` differs from `encodeURIComponent()` as follows:
Example:
const set1 = ";/?:@&=+$,#"; // Reserved Characters
const set2 = "-.!~*'()"; // Unreserved Marks
const set3 = "ABC abc 123"; // Alphanumeric Characters + Sp... | [
0.14489267766475677,
-0.36666882038116455,
-0.5911484360694885,
0.2089153230190277,
0.2548542618751526,
-0.775122344493866,
0.2553405463695526,
0.6827391982078552,
0.006567878648638725,
-0.28266310691833496,
-0.7003734707832336,
-0.05528683215379715,
-0.4348590672016144,
0.0966756343841552... |
javascript/reference/global_objects/encodeuri/index.md | JavaScript - Global Objects - encodeURI - Examples - Encoding a lone surrogate throws:
A `URIError` will be thrown if one attempts to encode a surrogate which is not part of a high-low pair. For example:
Example:
// High-low pair OK
encodeURI("\uD800\uDFFF"); // "%F0%90%8F%BF"
// Lone high-surrogate code unit throw... | [
-0.7357550263404846,
1.2344309091567993,
-0.8189008235931396,
0.1265902817249298,
-0.42733508348464966,
-0.6892044544219971,
0.39595144987106323,
1.1195652484893799,
-1.3298594951629639,
-0.44046705961227417,
-1.0478390455245972,
-0.23937654495239258,
0.14993871748447418,
-0.19924247264862... |
javascript/reference/global_objects/encodeuri/index.md | JavaScript - Global Objects - encodeURI - Examples - Encoding for RFC3986:
The more recent RFC3986 makes square brackets reserved (for `IPv6`) and thus not encoded when forming something which could be part of a URL (such as a host). It also reserves !, ', (, ), and , even though these characters have no formalized UR... | [
-0.9111568331718445,
0.7957360744476318,
-0.23673580586910248,
-0.13439926505088806,
-0.3114447295665741,
-0.8904716372489929,
0.0776190236210823,
-0.4766577184200287,
-0.4127993881702423,
-0.9370228052139282,
-0.9061816334724426,
0.45206162333488464,
-0.5573199987411499,
-0.39083641767501... |
javascript/reference/global_objects/object/setprototypeof/index.md | JavaScript - Global Objects - Object - setPrototypeOf:
The `Object.setPrototypeOf()` static method sets the prototype (i.e., the internal `[[Prototype]]` property) of a specified object to another object or `null`.
Warning: Changing the `[[Prototype]]` of an object is, by the nature of how modern JavaScript engines o... | [
0.74703049659729,
-0.26679113507270813,
-0.9384680390357971,
1.2987949848175049,
0.7090764045715332,
-0.9437429308891296,
-0.1224207803606987,
0.6503148078918457,
-0.050122588872909546,
-0.45790672302246094,
-1.1221479177474976,
0.8150836825370789,
0.4048575758934021,
0.25848180055618286,
... |
javascript/reference/global_objects/object/setprototypeof/index.md | JavaScript - Global Objects - Object - setPrototypeOf - Syntax:
Example:
Object.setPrototypeOf(obj, prototype) | [
-0.5146811604499817,
-0.12947143614292145,
-0.618364155292511,
-0.1514190137386322,
-0.6737803220748901,
-1.163343906402588,
-0.20853865146636963,
0.73924720287323,
0.5457208156585693,
-0.6377102732658386,
-0.7123691439628601,
0.03566751256585121,
0.2261437177658081,
-0.008119858801364899,... |
javascript/reference/global_objects/object/setprototypeof/index.md | JavaScript - Global Objects - Object - setPrototypeOf - Syntax - Parameters:
- `obj`: The object which is to have its prototype set.
- `prototype`: The object's new prototype (an object or `null`). | [
-0.7148476839065552,
-0.24628470838069916,
-1.1066852807998657,
-0.04248632863163948,
-0.08105665445327759,
-1.269940733909607,
-0.22178229689598083,
0.3773161768913269,
0.7200517058372498,
-0.4115526080131531,
-1.161446452140808,
0.17054367065429688,
-0.05215178802609444,
0.48875433206558... |
javascript/reference/global_objects/object/setprototypeof/index.md | JavaScript - Global Objects - Object - setPrototypeOf - Syntax - Return value:
The specified object. | [
-0.32778632640838623,
-0.45864906907081604,
-0.845958411693573,
-0.16325166821479797,
-0.5548082590103149,
-1.2545580863952637,
0.19371263682842255,
0.7332839965820312,
-0.05506867170333862,
-0.36349228024482727,
-0.8757484555244446,
0.9464219808578491,
0.08481474965810776,
0.7903061509132... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.