file stringlengths 16 94 | text stringlengths 32 24.4k | vector list |
|---|---|---|
javascript/reference/global_objects/date/tolocaletimestring/index.md | JavaScript - Global Objects - Date - toLocaleTimeString - Syntax:
Example:
toLocaleTimeString()
toLocaleTimeString(locales)
toLocaleTimeString(locales, options) | [
-0.7830427885055542,
0.6065570712089539,
-0.03889212757349014,
0.18246088922023773,
-0.4945002794265747,
-2.4143247604370117,
0.20775596797466278,
0.5296837091445923,
-0.2427484393119812,
-0.6802424192428589,
0.23334693908691406,
0.1773402839899063,
0.2544507682323456,
-0.03548787906765938... |
javascript/reference/global_objects/date/tolocaletimestring/index.md | JavaScript - Global Objects - Date - toLocaleTimeString - Syntax - Parameters:
The `locales` and `options` parameters customize the behavior of the function and let applications specify the language whose formatting conventions should be used.
In implementations that support the `Intl.DateTimeFormat` API, these param... | [
-0.7854050993919373,
0.31576886773109436,
-0.7184311151504517,
0.7602304220199585,
-0.053383585065603256,
-1.7169967889785767,
1.0170739889144897,
-0.6097620129585266,
-0.09405743330717087,
0.2634483575820923,
-0.9689311385154724,
-0.025570794939994812,
0.49415716528892517,
0.2604206204414... |
javascript/reference/global_objects/date/tolocaletimestring/index.md | JavaScript - Global Objects - Date - toLocaleTimeString - Syntax - Return value:
A string representing the time portion of the given date according to language-specific conventions.
In implementations with `Intl.DateTimeFormat`, this is equivalent to `new Intl.DateTimeFormat(locales, options).format(date)`, where `op... | [
-1.1428699493408203,
0.41950100660324097,
0.20492060482501984,
0.9692932963371277,
0.8614876866340637,
-1.0177628993988037,
0.9796298146247864,
0.5146917104721069,
-1.0649354457855225,
0.06654264777898788,
-0.5743562579154968,
-0.15624508261680603,
-0.08566759526729584,
0.20768792927265167... |
javascript/reference/global_objects/date/tolocaletimestring/index.md | JavaScript - Global Objects - Date - toLocaleTimeString - Examples - Using toLocaleTimeString():
Basic use of this method without specifying a `locale` returns a formatted string in the default locale and with default options.
Example:
const date = new Date(Date.UTC(2012, 11, 12, 3, 0, 0));
// toLocaleTimeString() ... | [
-0.9675318002700806,
0.08204909414052963,
-0.8696579337120056,
0.7201390862464905,
-0.18400558829307556,
-1.7628732919692993,
0.034571025520563126,
-0.021698785945773125,
-0.08788697421550751,
-0.41685861349105835,
0.08922897279262543,
0.6730583906173706,
0.44140657782554626,
-0.2156800776... |
javascript/reference/global_objects/date/tolocaletimestring/index.md | JavaScript - Global Objects - Date - toLocaleTimeString - Examples - Checking for support for locales and options parameters:
The `locales` and `options` parameters may not be supported in all implementations, because support for the internationalization API is optional, and some systems may not have the necessary dat... | [
-0.9179757833480835,
0.031693775206804276,
-0.49064964056015015,
0.6060903072357178,
-0.28116390109062195,
-1.6157039403915405,
0.9290105700492859,
-0.46130725741386414,
-0.49172353744506836,
-0.07576075196266174,
-0.12514257431030273,
-0.4236705005168915,
0.8869271278381348,
0.22827643156... |
javascript/reference/global_objects/date/tolocaletimestring/index.md | JavaScript - Global Objects - Date - toLocaleTimeString - Examples - Using locales:
This example shows some of the variations in localized time formats. In order to get the format of the language used in the user interface of your application, make sure to specify that language (and possibly some fallback languages) u... | [
-0.22134529054164886,
0.23403842747211456,
-0.6807409524917603,
0.43246832489967346,
0.058049414306879044,
-1.1034104824066162,
0.5343709588050842,
0.3349269926548004,
-0.5449482202529907,
-0.062273088842630386,
-0.22349713742733002,
-0.02259967289865017,
0.19722701609134674,
0.24883398413... |
javascript/reference/global_objects/date/tolocaletimestring/index.md | JavaScript - Global Objects - Date - toLocaleTimeString - Examples - Using options:
The results provided by `toLocaleTimeString()` can be customized using the `options` parameter:
Example:
const date = new Date(Date.UTC(2012, 11, 20, 3, 0, 0));
// An application may want to use UTC and make that visible
const optio... | [
-0.7294761538505554,
0.30765125155448914,
-1.1632122993469238,
0.7956944704055786,
-0.1244194284081459,
-1.8097833395004272,
-0.11804047971963882,
-0.3413117825984955,
0.04887715354561806,
0.338092565536499,
-0.01154310442507267,
0.5826315879821777,
0.6266671419143677,
-0.06657105684280396... |
javascript/reference/global_objects/date/setutcminutes/index.md | JavaScript - Global Objects - Date - setUTCMinutes:
The `setUTCMinutes()` method of `Date` instances changes the minutes for this date according to universal time.
Example:
const date = new Date("December 31, 1975, 23:15:30 GMT+11:00");
console.log(date.getUTCMinutes());
// Expected output: 15
date.setUTCMinutes(2... | [
-0.4040187895298004,
-0.12534935772418976,
-1.411080002784729,
1.005977988243103,
-0.33957943320274353,
-1.5295984745025635,
-0.439910888671875,
0.4741448760032654,
0.2953055799007416,
0.03460203856229782,
-0.3723601698875427,
0.525231122970581,
0.07399999350309372,
0.3136168122291565,
-... |
javascript/reference/global_objects/date/setutcminutes/index.md | JavaScript - Global Objects - Date - setUTCMinutes - Syntax:
Example:
setUTCMinutes(minutesValue)
setUTCMinutes(minutesValue, secondsValue)
setUTCMinutes(minutesValue, secondsValue, msValue) | [
-0.5498955845832825,
0.6378776431083679,
-1.2600195407867432,
0.7936328649520874,
-0.5928499102592468,
-1.3580602407455444,
0.02271203324198723,
0.49975478649139404,
0.47017547488212585,
-0.4862177073955536,
-0.09476260095834732,
0.3148316740989685,
0.7206408381462097,
-0.23645281791687012... |
javascript/reference/global_objects/date/setutcminutes/index.md | JavaScript - Global Objects - Date - setUTCMinutes - Syntax - Parameters:
- `minutesValue`: An integer between 0 and 59 representing the minutes.
- `secondsValue` (optional): An integer between 0 and 59 representing the seconds. If you specify `secondsValue`, you must also specify `minutesValue`.
- `msValue` (optional... | [
-0.928993821144104,
-0.023001909255981445,
-0.8071902394294739,
0.08216489106416702,
-0.1056005209684372,
-1.2458713054656982,
-0.13378413021564484,
0.10654400289058685,
0.7624944448471069,
0.0566561333835125,
-0.2646907866001129,
0.1899462640285492,
0.6242755651473999,
-0.1604358255863189... |
javascript/reference/global_objects/date/setutcminutes/index.md | JavaScript - Global Objects - Date - setUTCMinutes - Syntax - Return value:
Changes the `Date` object in place, and returns its new timestamp. If a parameter is `NaN` (or other values that get coerced to `NaN`, such as `undefined`), the date is set to Invalid Date and `NaN` is returned. | [
-0.9042519927024841,
0.0715705081820488,
-1.0071057081222534,
0.4110299050807953,
-0.40029823780059814,
-1.5257842540740967,
0.3551428020000458,
0.8464903831481934,
-0.8724917769432068,
0.4795243740081787,
-0.49951258301734924,
0.6924683451652527,
0.16109469532966614,
0.4267010986804962,
... |
javascript/reference/global_objects/date/setutcminutes/index.md | JavaScript - Global Objects - Date - setUTCMinutes - Description:
If you do not specify the `secondsValue` and `msValue` parameters, the values returned from `getUTCSeconds()` and `getUTCMilliseconds()` methods are used.
If a parameter you specify is outside of the expected range, `setUTCMinutes()` attempts to update... | [
-1.5166072845458984,
0.2856388986110687,
-1.5356627702713013,
0.9338154196739197,
-0.2589940130710602,
-1.3934590816497803,
0.4225497841835022,
-0.1357155591249466,
0.3589639961719513,
-0.046104755252599716,
-0.042027778923511505,
0.45985719561576843,
0.5297195315361023,
-0.002342093270272... |
javascript/reference/global_objects/date/setutcminutes/index.md | JavaScript - Global Objects - Date - setUTCMinutes - Examples - Using setUTCMinutes():
Example:
const theBigDay = new Date();
theBigDay.setUTCMinutes(43); | [
-0.7543979287147522,
0.33458152413368225,
-1.2906323671340942,
0.6559820175170898,
-0.6454725861549377,
-0.9714736342430115,
-0.022650709375739098,
-0.18472224473953247,
-0.03472915664315224,
-0.5415611267089844,
-0.5166980624198914,
0.1352136880159378,
0.3943099081516266,
0.09798755496740... |
javascript/reference/global_objects/date/getutchours/index.md | JavaScript - Global Objects - Date - getUTCHours:
The `getUTCHours()` method of `Date` instances returns the hours for this date according to universal time.
Example:
const date1 = new Date("December 31, 1975, 23:15:30 GMT+11:00");
const date2 = new Date("December 31, 1975, 23:15:30 GMT-11:00");
console.log(date1.g... | [
0.15684759616851807,
-0.08474995195865631,
-1.6931488513946533,
0.7915632724761963,
-0.3443296253681183,
-1.6674978733062744,
-0.6004246473312378,
0.3827589154243469,
-0.20794790983200073,
0.037685833871364594,
-0.0080626355484128,
0.6267591118812561,
0.2001778483390808,
0.5815129280090332... |
javascript/reference/global_objects/date/getutchours/index.md | JavaScript - Global Objects - Date - getUTCHours - Syntax:
Example:
getUTCHours() | [
0.13972322642803192,
0.33808717131614685,
-1.7761532068252563,
0.5317804217338562,
-1.0046770572662354,
-2.269835948944092,
-0.2226230353116989,
0.7041776776313782,
-0.22614791989326477,
-0.5117397904396057,
0.17222464084625244,
0.3161543905735016,
-0.04438687115907669,
0.29875320196151733... |
javascript/reference/global_objects/date/getutchours/index.md | JavaScript - Global Objects - Date - getUTCHours - Syntax - Parameters:
None. | [
0.06888478994369507,
0.4569054841995239,
-1.790731430053711,
0.22845301032066345,
-0.7278367280960083,
-1.4695533514022827,
0.30129334330558777,
1.0711429119110107,
-0.20636749267578125,
-0.49138084053993225,
-0.18251293897628784,
-0.3192806541919708,
0.06521692126989365,
0.229916408658027... |
javascript/reference/global_objects/date/getutchours/index.md | JavaScript - Global Objects - Date - getUTCHours - Syntax - Return value:
An integer, between 0 and 23, representing the hours for the given date according to universal time. Returns `NaN` if the date is invalid. | [
-0.17346353828907013,
0.24358141422271729,
-1.1029534339904785,
0.21217067539691925,
-0.784009575843811,
-1.4794352054595947,
0.17316050827503204,
0.48276519775390625,
-0.9369367957115173,
0.3420719802379608,
-0.29574301838874817,
0.666054368019104,
0.18407276272773743,
0.03867143020033836... |
javascript/reference/global_objects/date/getutchours/index.md | JavaScript - Global Objects - Date - getUTCHours - Examples - Using getUTCHours():
The following example assigns the hours portion of the current time to the variable `hours`.
Example:
const today = new Date();
const hours = today.getUTCHours(); | [
-0.22684279084205627,
0.4168587923049927,
-1.5969246625900269,
0.9889853596687317,
-0.792475700378418,
-1.6585493087768555,
-0.13494035601615906,
0.02243538200855255,
0.2435605376958847,
-0.29598838090896606,
-0.12468253821134567,
0.15580379962921143,
0.04289276525378227,
0.387528717517852... |
javascript/reference/global_objects/date/tojson/index.md | JavaScript - Global Objects - Date - toJSON:
The `toJSON()` method of `Date` instances returns a string representing this date in the same ISO format as `toISOString()`.
Example:
const event = new Date("August 19, 1975 23:15:30 UTC");
const jsonDate = event.toJSON();
console.log(jsonDate);
// Expected output: "197... | [
-0.5963961482048035,
0.1373051404953003,
-1.2586750984191895,
0.15100109577178955,
-0.009258397854864597,
-2.055910348892212,
-0.6251280903816223,
0.24825812876224518,
-0.3645739257335663,
0.6088978052139282,
0.048694461584091187,
0.8336402773857117,
0.044057734310626984,
0.364477187395095... |
javascript/reference/global_objects/date/tojson/index.md | JavaScript - Global Objects - Date - toJSON - Syntax:
Example:
toJSON() | [
-0.6721835136413574,
0.5517842173576355,
-0.8411779999732971,
-0.25277426838874817,
-0.5859494805335999,
-2.34940767288208,
0.034093622118234634,
0.7413983345031738,
-0.6289108395576477,
-0.15103469789028168,
0.03811747953295708,
0.8515779972076416,
-0.36297085881233215,
0.1154938638210296... |
javascript/reference/global_objects/date/tojson/index.md | JavaScript - Global Objects - Date - toJSON - Syntax - Parameters:
None. | [
-0.5728685855865479,
0.4286903738975525,
-1.0581640005111694,
-0.5406717658042908,
-0.5164936780929565,
-1.918863296508789,
0.739989161491394,
0.933024525642395,
-0.5832608938217163,
-0.3137567639350891,
-0.4618764817714691,
-0.08144188672304153,
-0.10034680366516113,
0.11865969747304916,
... |
javascript/reference/global_objects/date/tojson/index.md | JavaScript - Global Objects - Date - toJSON - Syntax - Return value:
A string representing the given date in the date time string format according to universal time, or `null` when the date is invalid. For valid dates, the return value is the same as that of `toISOString()`. | [
-1.3977056741714478,
0.4476592242717743,
-0.36393025517463684,
0.21872693300247192,
0.02410234324634075,
-2.1880505084991455,
0.5103598237037659,
0.678300142288208,
-0.8072511553764343,
0.7337448596954346,
-0.058538492769002914,
0.8497791886329651,
0.10221463441848755,
0.804271399974823,
... |
javascript/reference/global_objects/date/tojson/index.md | JavaScript - Global Objects - Date - toJSON - Description:
The `toJSON()` method is automatically called by `JSON.stringify()` when a `Date` object is stringified. This method is generally intended to, by default, usefully serialize `Date` objects during JSON serialization, which can then be deserialized using the `Da... | [
-1.4575245380401611,
0.524192214012146,
-0.5387803912162781,
-0.2724280059337616,
0.13367107510566711,
-1.439210295677185,
1.1015208959579468,
0.4837148189544678,
-0.8267488479614258,
1.133345365524292,
-0.6085342764854431,
0.022320913150906563,
-0.038770515471696854,
0.0703531876206398,
... |
javascript/reference/global_objects/date/tojson/index.md | JavaScript - Global Objects - Date - toJSON - Examples - Using toJSON():
Example:
const jsonDate = new Date(0).toJSON(); // '1970-01-01T00:00:00.000Z'
const backToDate = new Date(jsonDate);
console.log(jsonDate); // 1970-01-01T00:00:00.000Z | [
-0.6369678378105164,
0.5091075301170349,
-1.2044354677200317,
0.20918935537338257,
-0.07002083212137222,
-2.073383331298828,
0.032453227788209915,
0.14275965094566345,
-0.22799725830554962,
0.16925323009490967,
-0.2838539481163025,
0.9124254584312439,
-0.35493433475494385,
0.29388457536697... |
javascript/reference/global_objects/date/tojson/index.md | JavaScript - Global Objects - Date - toJSON - Examples - Serialization round-tripping:
When parsing JSON containing date strings, you can use the `Date()` constructor to revive them into the original date objects.
Example:
const fileData = {
author: "Maria",
title: "Date.prototype.toJSON()",
createdAt: new Dat... | [
-1.165497064590454,
0.053291115909814835,
-1.0852283239364624,
0.2939603924751282,
0.6285433173179626,
-1.662596583366394,
0.32637545466423035,
0.6248370409011841,
-0.840674102306366,
0.8155695199966431,
-0.06359098106622696,
0.8326552510261536,
0.03899809345602989,
0.015881288796663284,
... |
javascript/reference/global_objects/decodeuri/index.md | JavaScript - Global Objects - decodeURI:
The `decodeURI()` function decodes a Uniform Resource Identifier (URI) previously created by `encodeURI()` or a similar routine.
Example:
const uri = "https://mozilla.org/?x=шеллы";
const encoded = encodeURI(uri);
console.log(encoded);
// Expected output: "https://mozilla.org... | [
0.31349071860313416,
0.33318400382995605,
-0.6830929517745972,
1.0254886150360107,
0.25208619236946106,
-1.3388965129852295,
0.31937193870544434,
0.8033745288848877,
-0.1285286247730255,
-0.14134715497493744,
-0.5971267819404602,
0.036169908940792084,
0.15378952026367188,
0.334460645914077... |
javascript/reference/global_objects/decodeuri/index.md | JavaScript - Global Objects - decodeURI - Syntax:
Example:
decodeURI(encodedURI) | [
0.5262160897254944,
0.33364138007164,
-0.36480817198753357,
-0.41796010732650757,
-1.5894087553024292,
-1.4847724437713623,
0.27348315715789795,
0.5633137822151184,
-0.03196597099304199,
-0.5811344385147095,
-0.8729669451713562,
0.40535181760787964,
0.11580842733383179,
0.03226816281676292... |
javascript/reference/global_objects/decodeuri/index.md | JavaScript - Global Objects - decodeURI - Syntax - Parameters:
- `encodedURI`: A complete, encoded Uniform Resource Identifier. | [
0.2649770677089691,
0.25018420815467834,
-1.1787519454956055,
-0.084524005651474,
-1.2314460277557373,
-1.8053441047668457,
-0.12692749500274658,
0.3832736909389496,
0.49218833446502686,
-0.5597304105758667,
-1.1591285467147827,
0.17782343924045563,
0.03354208171367645,
0.2885027527809143,... |
javascript/reference/global_objects/decodeuri/index.md | JavaScript - Global Objects - decodeURI - Syntax - Return value:
A new string representing the unencoded version of the given encoded Uniform Resource Identifier (URI). | [
-0.26781949400901794,
0.15706349909305573,
-0.8184535503387451,
-0.07723537087440491,
-1.0248504877090454,
-1.5825061798095703,
0.5291611552238464,
0.9332262873649597,
0.14369817078113556,
-0.0212156530469656,
-1.1225992441177368,
0.4895198345184326,
-0.006858875509351492,
0.82379025220870... |
javascript/reference/global_objects/decodeuri/index.md | JavaScript - Global Objects - decodeURI - Syntax - Exceptions:
- `URIError`: Thrown if `encodedURI` contains a `%` not followed by two hexadecimal digits, or if the escape sequence does not encode a valid UTF-8 character. | [
-1.1479140520095825,
-0.22307798266410828,
-0.2529391348361969,
0.6235013008117676,
-0.7832814455032349,
-1.129480242729187,
-0.3598061800003052,
0.28841161727905273,
-0.32536524534225464,
-0.3973234295845032,
-1.0914506912231445,
0.20667347311973572,
-0.30285757780075073,
-0.4941506087779... |
javascript/reference/global_objects/decodeuri/index.md | JavaScript - Global Objects - decodeURI - Description:
`decodeURI()` is a function property of the global object.
The `decodeURI()` function decodes the URI by treating each escape sequence in the form `%XX` as one UTF-8 code unit (one byte). In UTF-8, the number of leading 1 bits in the first byte, which may be 0 (f... | [
-0.28248631954193115,
-0.09082376211881638,
-1.2516629695892334,
0.009882720187306404,
-0.3556315302848816,
-0.9546946883201599,
0.12041580677032471,
0.10407651960849762,
-0.06887591630220413,
-0.19929096102714539,
-1.295780897140503,
-0.11204522103071213,
-0.09550507366657257,
0.223480090... |
javascript/reference/global_objects/decodeuri/index.md | JavaScript - Global Objects - decodeURI - Examples - Decoding a Cyrillic URL:
Example:
decodeURI(
"https://developer.mozilla.org/ru/docs/JavaScript_%D1%88%D0%B5%D0%BB%D0%BB%D1%8B",
);
// "https://developer.mozilla.org/ru/docs/JavaScript_шеллы" | [
-0.568531334400177,
0.5415925979614258,
-0.20140856504440308,
-0.09606775641441345,
-0.6611674427986145,
-0.5721167325973511,
0.00910365954041481,
0.25473812222480774,
-0.24225515127182007,
-0.4497477412223816,
0.14993242919445038,
0.09324751794338226,
-0.062466204166412354,
-0.40172514319... |
javascript/reference/global_objects/decodeuri/index.md | JavaScript - Global Objects - decodeURI - Examples - decodeURI() vs. decodeURIComponent():
`decodeURI()` assumes the input is a full URI, so it does not decode characters that are part of the URI syntax.
Example:
decodeURI(
"https://developer.mozilla.org/docs/JavaScript%3A%20a_scripting_language",
);
// "https://d... | [
0.7186635136604309,
0.08001790940761566,
-0.6265342831611633,
0.22684089839458466,
-0.48198890686035156,
-1.5874460935592651,
0.4454151690006256,
0.004687270149588585,
-0.024958411231637,
-0.758717954158783,
-0.4580128788948059,
-0.3783510625362396,
0.29934731125831604,
-0.1969050019979477... |
javascript/reference/global_objects/decodeuri/index.md | JavaScript - Global Objects - decodeURI - Examples - Catching errors:
Example:
try {
const a = decodeURI("%E0%A4%A");
} catch (e) {
console.error(e);
}
// URIError: malformed URI sequence | [
0.4235991835594177,
0.4128343164920807,
-0.9820826649665833,
-0.123040109872818,
-1.0722814798355103,
-0.7398141622543335,
0.19729670882225037,
0.319541335105896,
-1.1536927223205566,
-0.17767220735549927,
-0.5842425227165222,
-0.7644361257553101,
0.11395032703876495,
-0.18768605589866638,... |
javascript/reference/global_objects/float32array/index.md | JavaScript - Global Objects - Float32Array:
The `Float32Array` typed array represents an array of 32-bit floating point numbers in the platform byte order. If control over byte order is needed, use `DataView` instead. The contents are initialized to `0` unless initialization data is explicitly provided. Once establish... | [
-0.660021185874939,
-0.7597481608390808,
-1.1606767177581787,
0.18840906023979187,
0.6679893732070923,
-0.8063017129898071,
0.34351885318756104,
1.6081089973449707,
0.30625981092453003,
0.26431700587272644,
-0.3923325836658478,
0.33720579743385315,
0.04172542318701744,
0.037992775440216064... |
javascript/reference/global_objects/float32array/index.md | JavaScript - Global Objects - Float32Array - Constructor:
- `Float32Array()`: Creates a new `Float32Array` object. | [
-1.3251324892044067,
-0.01782376691699028,
-1.058271884918213,
0.10158485919237137,
-0.023058103397488594,
-0.9338279366493225,
-0.7261607050895691,
1.2632206678390503,
0.05704042315483093,
-0.05760599672794342,
-0.21314194798469543,
-0.060086119920015335,
-0.30477315187454224,
-0.01969149... |
javascript/reference/global_objects/float32array/index.md | JavaScript - Global Objects - Float32Array - Static properties:
Also inherits static properties from its parent `TypedArray`.
- `Float32Array.BYTES_PER_ELEMENT`: Returns a number value of the element size. `4` in the case of `Float32Array`. | [
-1.0056142807006836,
0.39668309688568115,
-1.0374690294265747,
-0.032174061983823776,
0.10128089785575867,
-1.3539704084396362,
0.47637152671813965,
1.1210943460464478,
-0.16561168432235718,
-0.1571619063615799,
-0.3745034337043762,
0.7690327167510986,
-0.5514693856239319,
-0.1166719570755... |
javascript/reference/global_objects/float32array/index.md | JavaScript - Global Objects - Float32Array - Static methods:
Inherits static methods from its parent `TypedArray`. | [
-0.532470703125,
0.05411897227168083,
-0.9802370667457581,
-0.14970259368419647,
0.1247788593173027,
-1.1909915208816528,
0.5278880000114441,
1.9738160371780396,
-0.35984039306640625,
-0.05244217813014984,
-0.5454591512680054,
-0.24686211347579956,
-0.6172236204147339,
-0.06675805896520615... |
javascript/reference/global_objects/float32array/index.md | JavaScript - Global Objects - Float32Array - Instance properties:
Also inherits instance properties from its parent `TypedArray`.
These properties are defined on `Float32Array.prototype` and shared by all `Float32Array` instances.
- `Float32Array.prototype.BYTES_PER_ELEMENT`: Returns a number value of the element si... | [
-0.24029669165611267,
-0.05449584126472473,
-0.37549149990081787,
0.4838080406188965,
0.8248621821403503,
-0.4417369067668915,
0.30770862102508545,
0.7533817291259766,
0.2651151120662689,
-0.07880967110395432,
-0.5042840242385864,
0.30841514468193054,
0.121248260140419,
0.05193085595965385... |
javascript/reference/global_objects/float32array/index.md | JavaScript - Global Objects - Float32Array - Instance methods:
Inherits instance methods from its parent `TypedArray`. | [
-0.18296435475349426,
-0.0854991003870964,
-0.656973659992218,
0.07870536297559738,
-0.07833483815193176,
-1.0056995153427124,
0.5586356520652771,
1.4082030057907104,
-0.44862979650497437,
-0.4673362672328949,
-0.2575208246707916,
0.07862945646047592,
-0.5464919209480286,
0.263220250606536... |
javascript/reference/global_objects/float32array/index.md | JavaScript - Global Objects - Float32Array - Examples - Different ways to create a Float32Array:
Example:
// From a length
const float32 = new Float32Array(2);
float32[0] = 42;
console.log(float32[0]); // 42
console.log(float32.length); // 2
console.log(float32.BYTES_PER_ELEMENT); // 4
// From an array
const x = new... | [
-0.2651299238204956,
-0.10868130624294281,
-0.6726466417312622,
0.23271861672401428,
0.5524182915687561,
-0.5935035347938538,
-0.7958242297172546,
0.7009493112564087,
0.2431962639093399,
-0.08257782459259033,
0.2581019401550293,
0.44799232482910156,
-0.6574577689170837,
-0.0338861681520938... |
javascript/reference/global_objects/float32array/float32array/index.md | JavaScript - Global Objects - Float32Array:
The `Float32Array()` constructor creates `Float32Array` objects. The contents are initialized to `0` unless initialization data is explicitly provided. | [
-0.7762746214866638,
-0.11577310413122177,
-0.8182988166809082,
0.5905452370643616,
-0.024746492505073547,
-1.1011313199996948,
-0.2555711269378662,
1.1723307371139526,
-0.2867988049983978,
0.24523766338825226,
-0.3403266370296478,
-0.30318906903266907,
-0.559598445892334,
-0.2915979027748... |
javascript/reference/global_objects/float32array/float32array/index.md | JavaScript - Global Objects - Float32Array - Syntax:
Example:
new Float32Array()
new Float32Array(length)
new Float32Array(typedArray)
new Float32Array(object)
new Float32Array(buffer)
new Float32Array(buffer, byteOffset)
new Float32Array(buffer, byteOffset, length)
Note: `Float32Array()` can only be constructed wi... | [
-0.6244311332702637,
-0.06599773466587067,
-1.0040420293807983,
-0.34045901894569397,
0.1600048542022705,
-1.0513439178466797,
-0.9243930578231812,
1.3964698314666748,
0.5327905416488647,
-0.180289164185524,
0.07457700371742249,
0.2713333070278168,
-0.008585604839026928,
0.1549286544322967... |
javascript/reference/global_objects/float32array/float32array/index.md | JavaScript - Global Objects - Float32Array - Syntax - Parameters:
See `TypedArray`. | [
0.138773575425148,
0.07695991545915604,
-0.8262019753456116,
-0.2634168863296509,
-0.223224475979805,
-0.7182027101516724,
0.1297536939382553,
1.463316559791565,
0.02503427490592003,
0.16591867804527283,
-0.02387985587120056,
0.1755736768245697,
0.1767757385969162,
0.22703655064105988,
-... |
javascript/reference/global_objects/float32array/float32array/index.md | JavaScript - Global Objects - Float32Array - Syntax - Exceptions:
See `TypedArray`. | [
-0.27134275436401367,
-0.2043846994638443,
-0.5601038932800293,
0.061925288289785385,
-0.36000391840934753,
-1.136523723602295,
-0.21353265643119812,
1.6119470596313477,
-0.1692531406879425,
-0.03254960477352142,
0.22057384252548218,
-0.12130996584892273,
-0.1406041979789734,
0.19742983579... |
javascript/reference/global_objects/float32array/float32array/index.md | JavaScript - Global Objects - Float32Array - Examples - Different ways to create a Float32Array:
Example:
// From a length
const float32 = new Float32Array(2);
float32[0] = 42;
console.log(float32[0]); // 42
console.log(float32.length); // 2
console.log(float32.BYTES_PER_ELEMENT); // 4
// From an array
const x = new... | [
-0.2651299238204956,
-0.10868130624294281,
-0.6726466417312622,
0.23271861672401428,
0.5524182915687561,
-0.5935035347938538,
-0.7958242297172546,
0.7009493112564087,
0.2431962639093399,
-0.08257782459259033,
0.2581019401550293,
0.44799232482910156,
-0.6574577689170837,
-0.0338861681520938... |
javascript/reference/global_objects/uint8array/index.md | JavaScript - Global Objects - Uint8Array:
The `Uint8Array` typed array represents an array of 8-bit unsigned integers. The contents are initialized to `0` unless initialization data is explicitly provided. Once established, you can reference elements in the array using the object's methods, or using standard array ind... | [
-0.9920070767402649,
-0.48942866921424866,
-0.9333902597427368,
0.7535783648490906,
-0.09220840781927109,
-1.0311859846115112,
0.5309139490127563,
1.3053723573684692,
-0.4337112605571747,
0.07380460202693939,
-0.47769975662231445,
0.2742229998111725,
0.38578107953071594,
-0.010051554068922... |
javascript/reference/global_objects/uint8array/index.md | JavaScript - Global Objects - Uint8Array - Description:
`Uint8Array` is currently the only `TypedArray` subclass that has additional methods compared to other typed arrays. Because of its nature as a generic byte array, it is the most suitable for working with arbitrary binary data. It supports two sets of methods for... | [
-0.49016624689102173,
-0.033730026334524155,
-0.29173263907432556,
0.3779813349246979,
1.1351455450057983,
0.07143614441156387,
0.389594703912735,
0.6952827572822571,
-0.08784885704517365,
0.32805660367012024,
-0.01944166235625744,
0.29936739802360535,
0.6768213510513306,
0.222654104232788... |
javascript/reference/global_objects/uint8array/index.md | JavaScript - Global Objects - Uint8Array - Constructor:
- `Uint8Array()`: Creates a new `Uint8Array` object. | [
-0.8416616320610046,
0.02080005221068859,
-1.1000381708145142,
0.7165737152099609,
-0.45182445645332336,
-1.2851403951644897,
-0.8415237069129944,
1.1007435321807861,
-0.43418553471565247,
0.14698921144008636,
-0.2816549241542816,
-0.07689638435840607,
0.5044205188751221,
-0.03492484986782... |
javascript/reference/global_objects/uint8array/index.md | JavaScript - Global Objects - Uint8Array - Static properties:
Also inherits static properties from its parent `TypedArray`.
- `Uint8Array.BYTES_PER_ELEMENT`: Returns a number value of the element size. `1` in the case of `Uint8Array`. | [
-0.8521804213523865,
0.3063191771507263,
-1.1691781282424927,
0.23281824588775635,
-0.16125960648059845,
-1.7938159704208374,
0.2676718235015869,
1.201659917831421,
-0.5926364660263062,
-0.0009274878539144993,
-0.6336119174957275,
0.6399810314178467,
-0.3455337882041931,
-0.066178813576698... |
javascript/reference/global_objects/uint8array/index.md | JavaScript - Global Objects - Uint8Array - Static methods:
Inherits static methods from its parent `TypedArray`.
- `Uint8Array.fromBase64()`: Creates a new `Uint8Array` object from a base64-encoded string.
- `Uint8Array.fromHex()`: Creates a new `Uint8Array` object from a hex-encoded string. | [
-0.34191766381263733,
-0.16251610219478607,
-0.9322280883789062,
0.6226788759231567,
0.2864755094051361,
-1.5514483451843262,
0.14743256568908691,
0.6803882122039795,
-0.39431557059288025,
0.1499369740486145,
-0.9503112435340881,
-0.16971412301063538,
-0.1956414431333542,
-0.20819441974163... |
javascript/reference/global_objects/uint8array/index.md | JavaScript - Global Objects - Uint8Array - Instance properties:
Also inherits instance properties from its parent `TypedArray`.
These properties are defined on `Uint8Array.prototype` and shared by all `Uint8Array` instances.
- `Uint8Array.prototype.BYTES_PER_ELEMENT`: Returns a number value of the element size. `1` ... | [
-0.3075532019138336,
-0.08841446787118912,
-1.154309630393982,
0.28906580805778503,
-0.05326049029827118,
-1.3873203992843628,
-0.15287822484970093,
0.8909109234809875,
-0.1582888662815094,
0.1235450729727745,
-0.7893725633621216,
0.8195887804031372,
-0.561206042766571,
0.37727776169776917... |
javascript/reference/global_objects/uint8array/index.md | JavaScript - Global Objects - Uint8Array - Instance methods:
Inherits instance methods from its parent `TypedArray`.
- `Uint8Array.prototype.setFromBase64()`: Populates this `Uint8Array` object with bytes from a base64-encoded string, returning an object indicating how many bytes were read and written.
- `Uint8Array.... | [
0.02261826954782009,
0.14153800904750824,
-0.737018883228302,
0.17899593710899353,
0.25053223967552185,
-1.4532452821731567,
0.03695862367749214,
0.3682284951210022,
0.000768018770031631,
-0.17950013279914856,
-0.7096207737922668,
0.60898357629776,
-0.08530879765748978,
0.02216600440442562... |
javascript/reference/global_objects/uint8array/index.md | JavaScript - Global Objects - Uint8Array - Examples - Different ways to create a Uint8Array:
Example:
// From a length
const uint8 = new Uint8Array(2);
uint8[0] = 42;
console.log(uint8[0]); // 42
console.log(uint8.length); // 2
console.log(uint8.BYTES_PER_ELEMENT); // 1
// From an array
const x = new Uint8Array([21,... | [
-0.1297071874141693,
-0.15729090571403503,
-1.1687089204788208,
0.528952956199646,
0.018996812403202057,
-0.8278695940971375,
-0.9345278143882751,
0.5988530516624451,
-0.3078649938106537,
0.12760625779628754,
0.14403606951236725,
0.42725324630737305,
-0.2146572470664978,
0.0679619833827018... |
javascript/reference/global_objects/uint8array/tohex/index.md | JavaScript - Global Objects - Uint8Array - toHex:
The `toHex()` method of `Uint8Array` instances returns a hex-encoded string based on the data in this `Uint8Array` object.
This method creates strings from a byte array. To convert individual numbers into hex, use the `Number.prototype.toString()` method with `radix` ... | [
-0.3953171670436859,
-0.14516493678092957,
-0.5405792593955994,
0.5127481818199158,
0.005246661603450775,
-1.7026702165603638,
0.096686452627182,
0.4973207414150238,
-0.5151815414428711,
-0.30811724066734314,
-0.7455488443374634,
0.8515226244926453,
0.0646333247423172,
-0.23084260523319244... |
javascript/reference/global_objects/uint8array/tohex/index.md | JavaScript - Global Objects - Uint8Array - toHex - Syntax:
Example:
toHex() | [
-0.6692845821380615,
0.4533981382846832,
-0.6106432676315308,
0.036038875579833984,
-0.7328298687934875,
-2.1897194385528564,
-0.3807232975959778,
1.0220963954925537,
-0.5111424922943115,
-0.5678815245628357,
-0.3651999831199646,
0.4449196755886078,
0.0371786467730999,
-0.04788274317979812... |
javascript/reference/global_objects/uint8array/tohex/index.md | JavaScript - Global Objects - Uint8Array - toHex - Syntax - Parameters:
None. | [
-0.15322251617908478,
0.478372722864151,
-0.8577377796173096,
-0.2926619052886963,
-0.6255808472633362,
-1.594908595085144,
0.18333345651626587,
1.1857296228408813,
-0.47833165526390076,
-0.5789916515350342,
-0.6866174936294556,
0.027663135901093483,
0.40549907088279724,
-0.107910417020320... |
javascript/reference/global_objects/uint8array/tohex/index.md | JavaScript - Global Objects - Uint8Array - toHex - Syntax - Return value:
A hex-encoded string representing the data in the `Uint8Array`. | [
-0.9126635789871216,
-0.17470547556877136,
-0.9068516492843628,
0.007763796951621771,
-0.46209245920181274,
-2.219874858856201,
-0.13140207529067993,
0.8534632325172424,
-0.29412099719047546,
-0.011664674617350101,
-0.5025871396064758,
0.7894106507301331,
0.03838669881224632,
0.47458952665... |
javascript/reference/global_objects/uint8array/tohex/index.md | JavaScript - Global Objects - Uint8Array - toHex - Examples - Encoding binary data:
This example encodes data from a `Uint8Array` into a hex string.
Example:
const uint8Array = new Uint8Array([202, 254, 208, 13]);
console.log(uint8Array.toHex()); // "cafed00d"
const data = new Uint8Array([255, 0, 0, 0, 255, 0, 0, 0... | [
-0.8769245743751526,
-0.16235266625881195,
-1.0199637413024902,
0.26698970794677734,
0.30113232135772705,
-1.1575863361358643,
-0.6498769521713257,
0.42392051219940186,
-0.15224434435367584,
0.12105872482061386,
-0.5836026668548584,
0.09814609587192535,
0.3611396253108978,
-0.4017173945903... |
javascript/reference/global_objects/uint8array/setfrombase64/index.md | JavaScript - Global Objects - Uint8Array - setFromBase64:
The `setFromBase64()` method of `Uint8Array` instances populates this `Uint8Array` object with bytes from a base64-encoded string, returning an object indicating how many bytes were read and written.
This method is most suitable for populating a pre-allocated ... | [
-0.008878756314516068,
-0.07078558951616287,
-0.6983616948127747,
0.8890488743782043,
0.8763074278831482,
-0.9860946536064148,
0.6623708605766296,
0.9572561979293823,
0.3682810068130493,
0.2296048104763031,
-0.3758917450904846,
0.44169944524765015,
0.6572762131690979,
0.33611011505126953,
... |
javascript/reference/global_objects/uint8array/setfrombase64/index.md | JavaScript - Global Objects - Uint8Array - setFromBase64 - Syntax:
Example:
setFromBase64(string)
setFromBase64(string, options) | [
0.18913908302783966,
0.11327154189348221,
-1.0418312549591064,
0.882485568523407,
-0.3799855709075928,
-1.988647222518921,
0.5613371133804321,
0.3940556049346924,
0.19979868829250336,
-0.2450883984565735,
-0.6162746548652649,
0.27629148960113525,
0.21434713900089264,
-0.0694875568151474,
... |
javascript/reference/global_objects/uint8array/setfrombase64/index.md | JavaScript - Global Objects - Uint8Array - setFromBase64 - Syntax - Parameters:
- `string`: A base64 string encoding bytes to write into a `Uint8Array`. It has the same requirements as the `string` parameter of `Uint8Array.fromBase64()`. Note that the string is only read up to the point where the array is filled, so a... | [
0.10412076860666275,
-0.20688067376613617,
-1.2478772401809692,
0.2885347604751587,
0.4509337246417999,
-2.0603911876678467,
0.4757227599620819,
0.04685825854539871,
0.793422520160675,
0.03546839952468872,
-0.8425242900848389,
0.12991733849048615,
-0.09180274605751038,
0.411288857460022,
... |
javascript/reference/global_objects/uint8array/setfrombase64/index.md | JavaScript - Global Objects - Uint8Array - setFromBase64 - Syntax - Return value:
An object containing the following properties:
- `read`: The number of base64 characters read from the input string. If the decoded data fits into the array, this is the length of the input string (including padding); otherwise, it is t... | [
-0.17925189435482025,
0.004645917098969221,
-0.7672192454338074,
0.37107419967651367,
0.1400880068540573,
-1.2677901983261108,
0.10382396727800369,
-0.201387420296669,
-0.12104285508394241,
0.2978549897670746,
-0.27573704719543457,
1.1399927139282227,
-0.4780519902706146,
0.647911310195922... |
javascript/reference/global_objects/uint8array/setfrombase64/index.md | JavaScript - Global Objects - Uint8Array - setFromBase64 - Syntax - Exceptions:
- `SyntaxError`: Thrown if the input string contains characters outside the specified alphabet, or if the last chunk does not satisfy the `lastChunkHandling` option.
- `TypeError`: Thrown in one of the following cases:
- The input string... | [
-0.6490621566772461,
-0.43289947509765625,
-0.21555927395820618,
0.6338897347450256,
-0.01519122812896967,
-1.8911148309707642,
0.18523910641670227,
0.5418226718902588,
-0.24890413880348206,
-0.1964244544506073,
-0.29317349195480347,
0.0064443317241966724,
-0.11335407942533493,
-0.19625948... |
javascript/reference/global_objects/uint8array/setfrombase64/index.md | JavaScript - Global Objects - Uint8Array - setFromBase64 - Examples - Decoding a base64 string:
This example uses the default `alphabet` and `lastChunkHandling` options to decode a base64 string into an existing `Uint8Array`.
Example:
const uint8Array = new Uint8Array(16);
const result = uint8Array.setFromBase64("PG... | [
-0.03230803459882736,
0.2490801066160202,
-0.17219601571559906,
0.7047874927520752,
0.38883528113365173,
-0.24286074936389923,
0.2957111597061157,
-0.07150086015462875,
0.4393943250179291,
-0.3036337196826935,
-0.044877320528030396,
0.1653941124677658,
0.530609130859375,
0.3869175612926483... |
javascript/reference/global_objects/uint8array/setfrombase64/index.md | JavaScript - Global Objects - Uint8Array - setFromBase64 - Examples - Decoding a big string into a small array:
If the string contains more data than the array can hold, the method will only write as many bytes as the array can hold, without discarding any bits.
Example:
const uint8Array = new Uint8Array(8);
const r... | [
0.2572047710418701,
0.1374218463897705,
-0.9372226595878601,
0.469216912984848,
0.2903604507446289,
-1.299288034439087,
-0.688648521900177,
0.009895040653645992,
-0.04014360532164574,
0.22564689815044403,
-0.40130865573883057,
0.8480545282363892,
0.1488741934299469,
-0.0415649488568306,
... |
javascript/reference/global_objects/uint8array/setfrombase64/index.md | JavaScript - Global Objects - Uint8Array - setFromBase64 - Examples - Setting data at a specific offset:
The `setFromBase64()` method always starts writing at the beginning of the `Uint8Array`. If you want to write to the middle of the array, you can write to a `TypedArray.prototype.subarray()` instead.
Example:
con... | [
0.12871986627578735,
-0.23134052753448486,
-1.3391191959381104,
0.21461749076843262,
0.0007001411286182702,
-0.42282068729400635,
-0.764214813709259,
0.8470642566680908,
0.3393475115299225,
0.10852092504501343,
-0.1737460494041443,
1.0070029497146606,
0.15650272369384766,
-0.02213138155639... |
javascript/reference/global_objects/uint8array/setfrombase64/index.md | JavaScript - Global Objects - Uint8Array - setFromBase64 - Examples - Stream decoding:
This example is adapted from the original proposal. It mimics the `TextDecoder` API with the `stream` option. Note the use of `lastChunkHandling: "stop-before-partial"` to handle incomplete chunks.
Example:
class Base64Decoder {
... | [
-0.06903772801160812,
-0.48109468817710876,
-0.8954101800918579,
0.12659046053886414,
0.2711581885814667,
-1.1955623626708984,
0.189602792263031,
-0.3237883746623993,
-0.1561453491449356,
0.8337103724479675,
0.037602052092552185,
-0.29497095942497253,
-0.016652854159474373,
0.0958079695701... |
javascript/reference/global_objects/uint8array/fromhex/index.md | JavaScript - Global Objects - Uint8Array - fromHex:
The `Uint8Array.fromHex()` static method creates a new `Uint8Array` object from a hexadecimal string.
This method parses the string into a byte array. To convert the string into a single number, use the `parseInt()` function with `radix` set to `16` instead. | [
-0.7421849966049194,
-0.185584157705307,
-0.7155075669288635,
0.3992499113082886,
0.1592106968164444,
-1.8680347204208374,
0.04310834780335426,
0.5022681355476379,
-0.51024329662323,
0.08947067707777023,
-1.1142209768295288,
0.3777115046977997,
-0.16361375153064728,
-0.3937021791934967,
... |
javascript/reference/global_objects/uint8array/fromhex/index.md | JavaScript - Global Objects - Uint8Array - fromHex - Syntax:
Example:
Uint8Array.fromHex(string) | [
-0.5962913036346436,
0.18243542313575745,
-0.6695461869239807,
-0.09994475543498993,
-0.8268040418624878,
-2.3208467960357666,
0.06721370667219162,
0.5197340846061707,
-0.6328956484794617,
-0.3398747742176056,
-0.6332360506057739,
0.2837963104248047,
-0.005763247609138489,
-0.1369325667619... |
javascript/reference/global_objects/uint8array/fromhex/index.md | JavaScript - Global Objects - Uint8Array - fromHex - Syntax - Parameters:
- `string`: A hexadecimal string encoding bytes to convert to a `Uint8Array`. The string must:
- Have an even number of characters because two characters encode one byte.
- Only contain characters in the hexadecimal alphabet, which includes ... | [
-0.4178518056869507,
0.07150048017501831,
-0.5192812085151672,
-0.0005178780993446708,
0.40378206968307495,
-1.5545705556869507,
-0.2325631082057953,
0.17748907208442688,
0.24831563234329224,
-0.19096319377422333,
-0.7650473117828369,
0.46050262451171875,
-0.30825453996658325,
-0.538861811... |
javascript/reference/global_objects/uint8array/fromhex/index.md | JavaScript - Global Objects - Uint8Array - fromHex - Syntax - Return value:
A new `Uint8Array` object containing the decoded bytes from the hexadecimal string. | [
-0.39667385816574097,
-0.040476106107234955,
-1.0838525295257568,
-0.010015269741415977,
-0.1842576563358307,
-1.7114434242248535,
0.08428137749433517,
0.5789624452590942,
-0.23143576085567474,
-0.10179220139980316,
-0.5891503095626831,
0.5652869343757629,
0.20395547151565552,
0.4242040812... |
javascript/reference/global_objects/uint8array/fromhex/index.md | JavaScript - Global Objects - Uint8Array - fromHex - Syntax - Exceptions:
- `SyntaxError`: Thrown if the input string contains characters outside the hex alphabet, or its length is odd.
- `TypeError`: Thrown if the input string is not a string. | [
-0.9774959683418274,
-0.1483396738767624,
-0.35614779591560364,
0.5816766619682312,
0.008061086758971214,
-2.4867899417877197,
-0.053217485547065735,
0.6074644327163696,
-0.4120079278945923,
-0.22463124990463257,
-0.7972773909568787,
-0.23459869623184204,
-0.49549493193626404,
-0.421645253... |
javascript/reference/global_objects/uint8array/fromhex/index.md | JavaScript - Global Objects - Uint8Array - fromHex - Examples - Decoding a hexadecimal string:
This example decodes a hexadecimal string into a `Uint8Array`.
Example:
const hexString = "cafed00d";
const bytes = Uint8Array.fromHex(hexString);
console.log(bytes); // Uint8Array [ 202, 254, 208, 13 ]
Uppercase characte... | [
-0.5758890509605408,
-0.13635577261447906,
-0.23003175854682922,
0.44596225023269653,
0.6475697159767151,
-0.9192894101142883,
0.575452983379364,
0.33832597732543945,
0.08665759861469269,
0.25982436537742615,
-0.181242436170578,
-0.19482262432575226,
0.2193852663040161,
0.5152552723884583,... |
javascript/reference/global_objects/uint8array/tobase64/index.md | JavaScript - Global Objects - Uint8Array - toBase64:
The `toBase64()` method of `Uint8Array` instances returns a base64-encoded string based on the data in this `Uint8Array` object.
This method should be preferred over `Window.btoa()`, especially if you already have a `Uint8Array` holding the object, because you don'... | [
-0.028114566579461098,
0.0310762207955122,
-0.8690857887268066,
1.0001232624053955,
0.10197433084249496,
-1.520867109298706,
0.3970036506652832,
0.04323798790574074,
0.17904213070869446,
0.2850879728794098,
-0.8266085386276245,
0.8994910717010498,
0.6651924848556519,
0.2042352855205536,
... |
javascript/reference/global_objects/uint8array/tobase64/index.md | JavaScript - Global Objects - Uint8Array - toBase64 - Syntax:
Example:
toBase64()
toBase64(options) | [
0.17503011226654053,
0.4345247149467468,
-0.7774888277053833,
0.7785083651542664,
-0.4715575575828552,
-2.021409749984741,
0.3286989629268646,
0.4401624798774719,
0.09194431453943253,
-0.43457651138305664,
-0.8039276599884033,
0.34468522667884827,
0.4831796884536743,
-0.02484304830431938,
... |
javascript/reference/global_objects/uint8array/tobase64/index.md | JavaScript - Global Objects - Uint8Array - toBase64 - Syntax - Parameters:
- `options` (optional): An object customizing the base64 string format. It can contain the following properties:
- `alphabet` (optional): A string specifying the base64 alphabet to use. It can be one of the following:
- `"base64"` (defaul... | [
0.08925222605466843,
-0.1642344743013382,
-1.0151045322418213,
0.6550268530845642,
0.21962028741836548,
-2.4080586433410645,
1.0290534496307373,
0.24775849282741547,
0.629452109336853,
-0.43733444809913635,
-1.3792729377746582,
0.2758929133415222,
-0.2023475617170334,
0.08982354402542114,
... |
javascript/reference/global_objects/uint8array/tobase64/index.md | JavaScript - Global Objects - Uint8Array - toBase64 - Syntax - Return value:
A base64-encoded string representing the data in the `Uint8Array`. | [
-0.15781114995479584,
-0.4027705192565918,
-1.2892099618911743,
0.17413115501403809,
-0.26006248593330383,
-2.129163980484009,
-0.0055638086050748825,
0.4922429025173187,
0.05526595935225487,
0.11076908558607101,
-0.8888757824897766,
1.1309266090393066,
0.04976300522685051,
0.4995984137058... |
javascript/reference/global_objects/uint8array/tobase64/index.md | JavaScript - Global Objects - Uint8Array - toBase64 - Syntax - Exceptions:
- `TypeError`: Thrown in one of the following cases:
- The `options` object is not an object or `undefined`.
- The `options.alphabet` is not of the expected values or `undefined`. | [
-0.28236135840415955,
-0.36661383509635925,
-0.919544517993927,
0.7079703211784363,
-0.2250903695821762,
-1.4711588621139526,
0.1494336575269699,
0.7270708680152893,
-0.1555512398481369,
-0.2984543740749359,
-0.48188671469688416,
-0.3830580413341522,
0.24728304147720337,
-0.266664206981658... |
javascript/reference/global_objects/uint8array/tobase64/index.md | JavaScript - Global Objects - Uint8Array - toBase64 - Examples - Encoding binary data:
This example uses the default `alphabet` and `omitPadding` options to encode data from a `Uint8Array` into a base64 string.
Example:
const uint8Array = new Uint8Array([29, 233, 101, 161]);
console.log(uint8Array.toBase64()); // "H... | [
-0.2972909212112427,
-0.21908734738826752,
-0.8698009848594666,
0.6427028775215149,
0.3300364017486572,
-1.7904682159423828,
0.02988397143781185,
-0.19168873131275177,
-0.0843832939863205,
0.20503714680671692,
-1.32429838180542,
0.3969956934452057,
0.4727350175380707,
-0.3426497280597687,
... |
javascript/reference/global_objects/uint8array/tobase64/index.md | JavaScript - Global Objects - Uint8Array - toBase64 - Examples - Encoding data without padding:
Example:
const uint8Array = new Uint8Array([29, 233, 101, 161]);
console.log(uint8Array.toBase64({ omitPadding: true })); // "HelloQ" | [
-0.7439798712730408,
-0.2551731765270233,
-0.3212715983390808,
0.23113155364990234,
-0.20465146005153656,
-1.6310499906539917,
0.06851542741060257,
-0.4848116636276245,
-0.5111891031265259,
0.05058867484331131,
-1.1092840433120728,
-0.12982521951198578,
0.43654659390449524,
-0.026254851371... |
javascript/reference/global_objects/uint8array/tobase64/index.md | JavaScript - Global Objects - Uint8Array - toBase64 - Examples - Encoding data with URL-safe alphabet:
This example populates a `URLSearchParams` object with a base64-encoded string using the URL-safe alphabet.
Example:
const uint8Array = new Uint8Array([46, 139, 222, 255, 42, 46]);
const base64 = uint8Array.toBase6... | [
-0.6584945917129517,
-0.12395467609167099,
-0.7407046556472778,
0.6019453406333923,
0.10991987586021423,
-1.0614055395126343,
-0.3717056214809418,
-0.6131750345230103,
-0.23526403307914734,
0.10728421062231064,
-0.9548974633216858,
0.7665579915046692,
0.5424549579620361,
-0.829558968544006... |
javascript/reference/global_objects/uint8array/tobase64/index.md | JavaScript - Global Objects - Uint8Array - toBase64 - Examples - Stream encoding:
This example is adapted from the original proposal, showcasing how to implement streaming in userland. It mimics the `TextEncoder` API with the `stream` option.
Example:
class Base64Encoder {
#extra;
#extraLength;
constructor() {... | [
-0.2804182171821594,
-0.04645046219229698,
-0.33155524730682373,
0.21184314787387848,
0.802412748336792,
-0.4053405523300171,
-0.23559892177581787,
0.5213332176208496,
-0.1456376314163208,
0.44187018275260925,
-0.056453172117471695,
0.3758692145347595,
-0.24127766489982605,
0.3537544012069... |
javascript/reference/global_objects/uint8array/uint8array/index.md | JavaScript - Global Objects - Uint8Array:
The `Uint8Array()` constructor creates `Uint8Array` objects. The contents are initialized to `0` unless initialization data is explicitly provided. | [
-0.33203884959220886,
0.0749090313911438,
-0.7846015095710754,
1.0837253332138062,
-0.5327447056770325,
-1.417641282081604,
-0.49201369285583496,
0.9196022152900696,
-0.752688467502594,
0.24891293048858643,
-0.35768479108810425,
-0.27097195386886597,
0.19452165067195892,
-0.254866510629653... |
javascript/reference/global_objects/uint8array/uint8array/index.md | JavaScript - Global Objects - Uint8Array - Syntax:
Example:
new Uint8Array()
new Uint8Array(length)
new Uint8Array(typedArray)
new Uint8Array(object)
new Uint8Array(buffer)
new Uint8Array(buffer, byteOffset)
new Uint8Array(buffer, byteOffset, length)
Note: `Uint8Array()` can only be constructed with `new`. Attempti... | [
-0.8338339328765869,
0.2664029598236084,
-1.0292038917541504,
0.013266649097204208,
-0.10490701347589493,
-1.7269049882888794,
-0.8146230578422546,
1.2198671102523804,
-0.257476806640625,
0.10544869303703308,
0.12334121018648148,
0.5522928237915039,
0.6439939737319946,
0.4384561777114868,
... |
javascript/reference/global_objects/uint8array/uint8array/index.md | JavaScript - Global Objects - Uint8Array - Syntax - Parameters:
See `TypedArray`. | [
0.23199568688869476,
0.006184861995279789,
-1.0403032302856445,
0.13913019001483917,
-0.5623093843460083,
-1.2160776853561401,
-0.16140970587730408,
1.2572762966156006,
-0.45958560705184937,
0.3832989037036896,
-0.24647581577301025,
0.02340918779373169,
0.6594972014427185,
0.38964506983757... |
javascript/reference/global_objects/uint8array/uint8array/index.md | JavaScript - Global Objects - Uint8Array - Syntax - Exceptions:
See `TypedArray`. | [
-0.10065395385026932,
-0.34292367100715637,
-0.7409822344779968,
0.42644748091697693,
-0.6778834462165833,
-1.6149652004241943,
-0.5638573169708252,
1.368461012840271,
-0.7232339382171631,
0.14562280476093292,
0.04766565188765526,
-0.3775649070739746,
0.3791482448577881,
0.3771999180316925... |
javascript/reference/global_objects/uint8array/uint8array/index.md | JavaScript - Global Objects - Uint8Array - Examples - Different ways to create a Uint8Array:
Example:
// From a length
const uint8 = new Uint8Array(2);
uint8[0] = 42;
console.log(uint8[0]); // 42
console.log(uint8.length); // 2
console.log(uint8.BYTES_PER_ELEMENT); // 1
// From an array
const x = new Uint8Array([21,... | [
-0.1297071874141693,
-0.15729090571403503,
-1.1687089204788208,
0.528952956199646,
0.018996812403202057,
-0.8278695940971375,
-0.9345278143882751,
0.5988530516624451,
-0.3078649938106537,
0.12760625779628754,
0.14403606951236725,
0.42725324630737305,
-0.2146572470664978,
0.0679619833827018... |
javascript/reference/global_objects/uint8array/frombase64/index.md | JavaScript - Global Objects - Uint8Array - fromBase64:
The `Uint8Array.fromBase64()` static method creates a new `Uint8Array` object from a base64-encoded string.
This method should be preferred over `Window.atob()` because it results in a byte array, which is easier to work with than a string containing raw bytes, u... | [
0.14239796996116638,
-0.4382683336734772,
-1.4260903596878052,
1.253025770187378,
0.30464857816696167,
-1.5892964601516724,
0.33533596992492676,
-0.03627907857298851,
0.40760958194732666,
0.473154753446579,
-1.077305793762207,
0.30845704674720764,
0.31420382857322693,
0.04945888742804527,
... |
javascript/reference/global_objects/uint8array/frombase64/index.md | JavaScript - Global Objects - Uint8Array - fromBase64 - Syntax:
Example:
Uint8Array.fromBase64(string)
Uint8Array.fromBase64(string, options) | [
0.16099026799201965,
-0.017978578805923462,
-0.7588930726051331,
0.5613667368888855,
-0.5026435256004333,
-2.114398717880249,
0.4387504756450653,
0.22351323068141937,
0.013269596733152866,
-0.17495380342006683,
-0.5726873278617859,
0.16828082501888275,
0.31365734338760376,
-0.3597109317779... |
javascript/reference/global_objects/uint8array/frombase64/index.md | JavaScript - Global Objects - Uint8Array - fromBase64 - Syntax - Parameters:
- `string`: A base64 string encoding bytes to convert to a `Uint8Array`. The string must only contain characters in the base64 alphabet, which includes A–Z, a–z, 0–9, and two special characters, which are either `+` and `/` (if using `alphabe... | [
0.17023251950740814,
0.11830669641494751,
-0.39595404267311096,
0.5725504755973816,
1.1763867139816284,
-0.5486002564430237,
0.059858452528715134,
0.532698929309845,
-0.03739017993211746,
-0.16246822476387024,
-0.040384404361248016,
0.5622518658638,
0.31420236825942993,
0.3296871781349182,... |
javascript/reference/global_objects/uint8array/frombase64/index.md | JavaScript - Global Objects - Uint8Array - fromBase64 - Syntax - Return value:
A new `Uint8Array` object containing the decoded bytes from the base64-encoded string. | [
0.14985761046409607,
-0.2756638824939728,
-1.399907112121582,
0.29731684923171997,
-0.10359768569469452,
-1.6370028257369995,
0.06143724173307419,
0.45864802598953247,
0.05712571740150452,
0.10205572843551636,
-0.8340581059455872,
0.7800358533859253,
0.26598402857780457,
0.3663051724433899... |
javascript/reference/global_objects/uint8array/frombase64/index.md | JavaScript - Global Objects - Uint8Array - fromBase64 - Syntax - Exceptions:
- `SyntaxError`: Thrown if the input string contains characters outside the specified alphabet, or if the last chunk does not satisfy the `lastChunkHandling` option.
- `TypeError`: Thrown in one of the following cases:
- The input string is... | [
-0.5567102432250977,
-0.42682331800460815,
-0.1395028531551361,
0.6948080658912659,
-0.038116972893476486,
-1.9176839590072632,
0.2654455900192261,
0.4364365041255951,
-0.2675129473209381,
-0.14317721128463745,
-0.3868831396102905,
-0.02022445946931839,
-0.20873834192752838,
-0.31833237409... |
javascript/reference/global_objects/uint8array/frombase64/index.md | JavaScript - Global Objects - Uint8Array - fromBase64 - Examples - Decoding a base64 string:
This example uses the default `alphabet` and `lastChunkHandling` options to decode a base64 string. Note that:
- The whitespace in the space is ignored.
- The string has 14 base64 characters, not a multiple of 4. This is only... | [
0.2562800347805023,
-0.24635151028633118,
-0.86722731590271,
0.39597034454345703,
0.5448566675186157,
-1.330605149269104,
0.819577157497406,
-0.6399151086807251,
-0.11470101773738861,
0.21424292027950287,
-1.037177562713623,
0.44687706232070923,
0.144343763589859,
0.19618594646453857,
0.... |
javascript/reference/global_objects/uint8array/frombase64/index.md | JavaScript - Global Objects - Uint8Array - fromBase64 - Examples - Decoding a URL-safe base64 string:
This example uses the `alphabet` option to decode a URL-safe base64 string.
Example:
const uint8Array = Uint8Array.fromBase64("PGI-TUROPC9iPg", {
alphabet: "base64url",
});
console.log(uint8Array); // Uint8Array(1... | [
-0.30477654933929443,
-0.0341070294380188,
-0.786811888217926,
0.15467436611652374,
0.00477934442460537,
-1.2897645235061646,
0.19041256606578827,
-0.595026969909668,
-0.09722059965133667,
0.2912595868110657,
-0.7335056662559509,
0.5594462156295776,
0.10946619510650635,
-0.6198465824127197... |
javascript/reference/global_objects/uint8array/frombase64/index.md | JavaScript - Global Objects - Uint8Array - fromBase64 - Examples - Decoding a base64 string with strict last chunk handling:
This example uses the `lastChunkHandling` option to decode a base64 string, where the last chunk must be exactly 4 characters long with padding `=` characters, and the overflow bits must be 0.
... | [
0.57999187707901,
-0.16745074093341827,
-0.2949641942977905,
0.7834205627441406,
0.27379634976387024,
-1.7300348281860352,
0.19912627339363098,
-0.5874043703079224,
-0.5079221725463867,
0.42659956216812134,
-0.8312016129493713,
0.2848610579967499,
0.43557044863700867,
0.12610867619514465,
... |
javascript/reference/global_objects/uint8array/frombase64/index.md | JavaScript - Global Objects - Uint8Array - fromBase64 - Examples - Decoding a base64 string with partial last chunk handling:
This example uses the `lastChunkHandling` option to decode a base64 string, ignoring any partial last chunk.
Example:
// The last chunk is complete
const array1 = Uint8Array.fromBase64("PGI+ ... | [
0.13776032626628876,
0.09877883642911911,
0.08750864863395691,
0.8830339312553406,
0.5794917345046997,
-0.4306907653808594,
0.5696752667427063,
0.3447572886943817,
0.23942914605140686,
0.11420252174139023,
-0.38761579990386963,
0.31371983885765076,
0.3599588871002197,
0.5634799599647522,
... |
javascript/reference/global_objects/uint8array/setfromhex/index.md | JavaScript - Global Objects - Uint8Array - setFromHex:
The `setFromHex()` method of `Uint8Array` instances populates this `Uint8Array` object with bytes from a hex-encoded string, returning an object indicating how many bytes were read and written.
This method parses the string into a byte array. To convert the strin... | [
-0.5831224918365479,
0.0021490766666829586,
-0.8116937279701233,
0.5379015803337097,
0.10536200553178787,
-1.8703521490097046,
0.1451537162065506,
0.16409911215305328,
-0.32826822996139526,
-0.09482220560312271,
-0.7883282899856567,
0.6199724674224854,
-0.16595366597175598,
-0.240382790565... |
javascript/reference/global_objects/uint8array/setfromhex/index.md | JavaScript - Global Objects - Uint8Array - setFromHex - Syntax:
Example:
setFromHex(string) | [
-0.6369798183441162,
0.190904438495636,
-0.7877235412597656,
0.13746966421604156,
-0.7785062193870544,
-2.3948144912719727,
0.12181397527456284,
0.5648068785667419,
-0.26729869842529297,
-0.47889405488967896,
-0.47033926844596863,
0.33936163783073425,
-0.04059021919965744,
0.00743893021717... |
javascript/reference/global_objects/uint8array/setfromhex/index.md | JavaScript - Global Objects - Uint8Array - setFromHex - Syntax - Parameters:
- `string`: A hexadecimal string encoding bytes to write into a `Uint8Array`. The string must: - Have an even number of characters because two characters encode one byte. - Only contain characters in the hexadecimal alphabet, which include... | [
-0.4522157609462738,
-0.10057719796895981,
-0.5805312991142273,
-0.014356949366629124,
0.6485255360603333,
-1.6664291620254517,
-0.028519950807094574,
0.19202814996242523,
0.27545490860939026,
-0.2621803879737854,
-0.6980977654457092,
0.6169614791870117,
-0.25411954522132874,
-0.2681786417... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.