file stringlengths 16 94 | text stringlengths 32 24.4k | vector list |
|---|---|---|
javascript/reference/global_objects/string/tostring/index.md | JavaScript - Global Objects - String - toString:
The `toString()` method of `String` values returns this string value.
Example:
const stringObj = new String("foo");
console.log(stringObj);
// Expected output: String { "foo" }
console.log(stringObj.toString());
// Expected output: "foo" | [
-1.2618498802185059,
-0.010112817399203777,
-0.8944721221923828,
0.05747365951538086,
-0.03241836652159691,
-2.3136801719665527,
-0.3245949149131775,
0.24853430688381195,
-0.33117055892944336,
-0.1325797587633133,
-0.5626593828201294,
0.3032017648220062,
0.20837955176830292,
0.045952267944... |
javascript/reference/global_objects/string/tostring/index.md | JavaScript - Global Objects - String - toString - Syntax:
Example:
toString() | [
-1.065101146697998,
0.47249191999435425,
-0.3433489501476288,
-0.07804005593061447,
-0.46916458010673523,
-2.4681026935577393,
0.10955017805099487,
0.5858301520347595,
-0.2947900593280792,
-1.0202168226242065,
-0.3786082863807678,
0.2910202145576477,
-0.3622276782989502,
-0.378071665763855... |
javascript/reference/global_objects/string/tostring/index.md | JavaScript - Global Objects - String - toString - Syntax - Parameters:
None. | [
-0.7704793810844421,
0.4128165543079376,
-0.5007839202880859,
-0.5693426728248596,
-0.4671470522880554,
-1.9787489175796509,
0.5572819113731384,
0.6469003558158875,
-0.428981214761734,
-1.0730229616165161,
-0.9482041597366333,
-0.5272360444068909,
-0.11742802709341049,
-0.14165356755256653... |
javascript/reference/global_objects/string/tostring/index.md | JavaScript - Global Objects - String - toString - Syntax - Return value:
A string representing the specified string value. | [
-0.7760394215583801,
0.03971630334854126,
-0.4522881805896759,
-0.055918749421834946,
-0.6206970810890198,
-2.191343307495117,
0.4562273621559143,
0.711216390132904,
-0.2687057852745056,
-0.3028930723667145,
-0.48675793409347534,
0.8375964760780334,
-0.6116929650306702,
0.8731809854507446,... |
javascript/reference/global_objects/string/tostring/index.md | JavaScript - Global Objects - String - toString - Description:
The `String` object overrides the `toString` method of `Object`; it does not inherit `Object.prototype.toString()`. For `String` values, the `toString` method returns the string itself (if it's a primitive) or the string that the `String` object wraps. It ... | [
-0.06441934406757355,
-0.11935287714004517,
-0.25442010164260864,
0.8211004734039307,
0.441493958234787,
-1.350147008895874,
0.5069466233253479,
0.825114369392395,
-0.6050007343292236,
-0.1277344971895218,
-0.4526509642601013,
0.2084140181541443,
-0.03726265951991081,
0.29370713233947754,
... |
javascript/reference/global_objects/string/tostring/index.md | JavaScript - Global Objects - String - toString - Examples - Using toString():
The following example displays the string value of a `String` object:
Example:
const x = new String("Hello world");
console.log(x.toString()); // "Hello world" | [
-1.4242405891418457,
0.12857940793037415,
-0.45390698313713074,
0.6337711215019226,
-0.41829603910446167,
-2.117887258529663,
-0.20357456803321838,
-0.16790273785591125,
0.11679133027791977,
-0.6205224394798279,
-0.2525196075439453,
0.13419193029403687,
0.2023526132106781,
-0.3473626971244... |
javascript/reference/global_objects/string/lastindexof/index.md | JavaScript - Global Objects - String - lastIndexOf:
The `lastIndexOf()` method of `String` values searches this string and returns the index of the last occurrence of the specified substring. It takes an optional starting position and returns the last occurrence of the specified substring at an index less than or equa... | [
-1.7240056991577148,
-1.006035566329956,
-0.6002529263496399,
0.3414701819419861,
-0.30980467796325684,
-1.2849743366241455,
0.31070104241371155,
-0.45480069518089294,
0.27751633524894714,
-0.3089433014392853,
-0.8976650238037109,
-0.1985488384962082,
-0.005581628065556288,
0.8047199845314... |
javascript/reference/global_objects/string/lastindexof/index.md | JavaScript - Global Objects - String - lastIndexOf - Syntax:
Example:
lastIndexOf(searchString)
lastIndexOf(searchString, position) | [
-1.1837358474731445,
-0.508946418762207,
-0.32358163595199585,
-0.637985348701477,
-0.628669798374176,
-1.4385279417037964,
0.2739028334617615,
0.11760585010051727,
0.27255237102508545,
-0.6943328976631165,
-0.5242041349411011,
-0.10418989509344101,
0.17343854904174805,
0.3678317666053772,... |
javascript/reference/global_objects/string/lastindexof/index.md | JavaScript - Global Objects - String - lastIndexOf - Syntax - Parameters:
- `searchString`: Substring to search for. All values are coerced to strings, so omitting it or passing `undefined` causes `lastIndexOf()` to search for the string `"undefined"`, which is rarely what you want.
- `position` (optional): The method... | [
-0.2572196424007416,
0.11013371497392654,
-0.17927886545658112,
0.8214133977890015,
0.6701856255531311,
-0.12775790691375732,
0.187302827835083,
-0.44331416487693787,
-0.5978140234947205,
-0.24495954811573029,
-0.7936773300170898,
-0.21416930854320526,
0.2627889811992645,
0.678428828716278... |
javascript/reference/global_objects/string/lastindexof/index.md | JavaScript - Global Objects - String - lastIndexOf - Syntax - Return value:
The index of the last occurrence of `searchString` found, or `-1` if not found. | [
-1.2446236610412598,
-0.6958206295967102,
-0.4792102575302124,
0.07855378091335297,
-0.26793786883354187,
-0.7448815107345581,
1.052029013633728,
0.6773925423622131,
-0.4025769829750061,
-0.4474765658378601,
-0.5675013065338135,
0.014626353047788143,
-0.34622177481651306,
0.934555351734161... |
javascript/reference/global_objects/string/lastindexof/index.md | JavaScript - Global Objects - String - lastIndexOf - Description:
Strings are zero-indexed: The index of a string's first character is `0`, and the index of a string's last character is the length of the string minus 1.
Example:
"canal".lastIndexOf("a"); // returns 3
"canal".lastIndexOf("a", 2); // returns 1
"canal"... | [
-1.0127031803131104,
-0.24693942070007324,
-0.008199500851333141,
-0.6559088230133057,
0.8974153399467468,
-0.7808589935302734,
0.5092027187347412,
0.40211671590805054,
-0.057465389370918274,
-0.07081256806850433,
-1.0473800897598267,
-0.7891093492507935,
-0.5022961497306824,
-0.0941263437... |
javascript/reference/global_objects/string/lastindexof/index.md | JavaScript - Global Objects - String - lastIndexOf - Description - Case-sensitivity:
The `lastIndexOf()` method is case sensitive. For example, the following expression returns `-1`:
Example:
"Blue Whale, Killer Whale".lastIndexOf("blue"); // returns -1 | [
-1.3792312145233154,
-0.5276432037353516,
-0.6368798613548279,
0.3204312324523926,
-0.2847021222114563,
-1.5718350410461426,
0.47535067796707153,
0.5993431806564331,
-0.4263037443161011,
-0.0963125005364418,
-0.17676877975463867,
0.322155237197876,
0.3197144567966461,
0.6098678708076477,
... |
javascript/reference/global_objects/string/lastindexof/index.md | JavaScript - Global Objects - String - lastIndexOf - Examples - Using indexOf() and lastIndexOf():
The following example uses `indexOf()` and `lastIndexOf()` to locate values in the string `"Brave, Brave New World"`.
Example:
const anyString = "Brave, Brave New World";
console.log(anyString.indexOf("Brave")); // 0
... | [
-0.6707026958465576,
-0.2819804251194,
-0.017091648653149605,
0.11540951579809189,
-0.358944296836853,
-1.0119667053222656,
0.9918575882911682,
-0.6911619305610657,
0.7873396873474121,
-0.6825326085090637,
-0.41127654910087585,
-0.3534657955169678,
0.2432483583688736,
0.19575315713882446,
... |
javascript/reference/global_objects/string/tolocalelowercase/index.md | JavaScript - Global Objects - String - toLocaleLowerCase:
The `toLocaleLowerCase()` method of `String` values returns this string converted to lower case, according to any locale-specific case mappings.
Example:
const dotted = "İstanbul";
console.log(`EN-US: ${dotted.toLocaleLowerCase("en-US")}`);
// Expected outpu... | [
-1.0635342597961426,
0.3015923798084259,
0.015409611165523529,
0.2507077753543854,
0.5966551899909973,
-1.4374877214431763,
0.2940487265586853,
0.42256981134414673,
-0.008328425697982311,
0.7159361839294434,
-0.608014702796936,
1.1341304779052734,
-0.11781923472881317,
0.3621697425842285,
... |
javascript/reference/global_objects/string/tolocalelowercase/index.md | JavaScript - Global Objects - String - toLocaleLowerCase - Syntax:
Example:
toLocaleLowerCase()
toLocaleLowerCase(locales) | [
-0.9504826068878174,
0.7795838117599487,
-0.11429303139448166,
0.09746547788381577,
-0.08333458006381989,
-2.127686023712158,
0.5432038903236389,
0.8262989521026611,
-0.5890180468559265,
-0.12952753901481628,
-0.9951015710830688,
0.6725418567657471,
-0.1263282597064972,
0.5308355689048767,... |
javascript/reference/global_objects/string/tolocalelowercase/index.md | JavaScript - Global Objects - String - toLocaleLowerCase - Syntax - Parameters:
- `locales` (optional): A string with a `BCP 47 language tag`, or an array of such strings. Indicates the locale to be used to convert to lower case according to any locale-specific case mappings. For the general form and interpretation of... | [
-1.6555984020233154,
0.45201417803764343,
0.0025138419587165117,
0.6306686997413635,
0.7321757674217224,
-2.0091488361358643,
1.5692875385284424,
-0.03668985143303871,
-0.10105731338262558,
0.2589259445667267,
-0.5924786329269409,
0.5348989963531494,
0.44275641441345215,
0.4897436797618866... |
javascript/reference/global_objects/string/tolocalelowercase/index.md | JavaScript - Global Objects - String - toLocaleLowerCase - Syntax - Return value:
A new string representing the calling string converted to lower case, according to any locale-specific case mappings. | [
-0.9800158143043518,
0.4246961772441864,
-0.22927621006965637,
0.05963556841015816,
0.3927531838417053,
-1.694008469581604,
0.5941752791404724,
0.8857727646827698,
-0.05327992141246796,
0.7230628728866577,
-0.7681630253791809,
0.753876805305481,
0.01862831600010395,
1.1090775728225708,
0... |
javascript/reference/global_objects/string/tolocalelowercase/index.md | JavaScript - Global Objects - String - toLocaleLowerCase - Description:
The `toLocaleLowerCase()` method returns the value of the string converted to lower case according to any locale-specific case mappings. `toLocaleLowerCase()` does not affect the value of the string itself. In most cases, this will produce the sam... | [
-1.3326857089996338,
0.3290247619152069,
-0.2149280309677124,
0.170943021774292,
0.6490938663482666,
-1.206648826599121,
1.2837727069854736,
0.30623042583465576,
-0.3517851233482361,
0.2056666612625122,
-0.6933578848838806,
1.1207234859466553,
-0.14150352776050568,
0.5557606220245361,
0.... |
javascript/reference/global_objects/string/tolocalelowercase/index.md | JavaScript - Global Objects - String - toLocaleLowerCase - Examples - Using toLocaleLowerCase():
Example:
"ALPHABET".toLocaleLowerCase(); // 'alphabet'
"\u0130".toLocaleLowerCase("tr") === "i"; // true
"\u0130".toLocaleLowerCase("en-US") === "i"; // false
const locales = ["tr", "TR", "tr-TR", "tr-u-co-search", "tr-... | [
-0.8908175230026245,
0.48839694261550903,
-0.11205711215734482,
0.4588940441608429,
0.6758619546890259,
-1.3694363832473755,
0.40712758898735046,
-0.25783228874206543,
-0.6467866897583008,
0.12579534947872162,
-0.6326636672019958,
0.5177695751190186,
-0.4000442922115326,
0.0442681014537811... |
javascript/reference/global_objects/string/at/index.md | JavaScript - Global Objects - String - at:
The `at()` method of `String` values takes an integer value and returns a new `String` consisting of the single UTF-16 code unit located at the specified offset. This method allows for positive and negative integers. Negative integers count back from the last string character... | [
-1.3155627250671387,
-0.8627077341079712,
-1.199149489402771,
-0.056477297097444534,
0.48415300250053406,
-1.689277172088623,
0.014795217663049698,
0.35964247584342957,
-0.22513729333877563,
-0.16104398667812347,
-0.777721107006073,
0.2978256642818451,
-0.022525429725646973,
-0.04320698603... |
javascript/reference/global_objects/string/at/index.md | JavaScript - Global Objects - String - at - Syntax:
Example:
at(index) | [
-0.34869158267974854,
-0.2447790801525116,
-1.0316864252090454,
-0.014146112836897373,
-0.928759753704071,
-1.872532844543457,
-0.005391405895352364,
0.33801743388175964,
-0.43777886033058167,
-0.19542713463306427,
0.04436732083559036,
-0.1264622062444687,
-0.2558688521385193,
-0.032168477... |
javascript/reference/global_objects/string/at/index.md | JavaScript - Global Objects - String - at - Syntax - Parameters:
- `index`: The index (position) of the string character to be returned. Supports relative indexing from the end of the string when passed a negative index; i.e., if a negative number is used, the character returned will be found by counting back from the... | [
-1.321984052658081,
-0.6216431856155396,
-0.7383363246917725,
-0.11830807477235794,
-0.10314859449863434,
-1.8407671451568604,
1.0284245014190674,
0.13811703026294708,
0.11650613695383072,
-0.07731199264526367,
-1.2818137407302856,
-0.08700857311487198,
-0.006278567481786013,
0.98539495468... |
javascript/reference/global_objects/string/at/index.md | JavaScript - Global Objects - String - at - Syntax - Return value:
A `String` consisting of the single UTF-16 code unit located at the specified position. Returns `undefined` if the given index can not be found. | [
-1.1198819875717163,
-0.1759033352136612,
-1.1523281335830688,
-0.2806975245475769,
-0.17189177870750427,
-1.594184160232544,
0.5183748006820679,
0.46242231130599976,
-0.0027593064587563276,
-0.16856437921524048,
-0.4054892361164093,
0.6612538695335388,
-0.056279055774211884,
0.37704643607... |
javascript/reference/global_objects/string/at/index.md | JavaScript - Global Objects - String - at - Examples - Return the last character of a string:
The following example provides a function which returns the last character found in a specified string.
Example:
// A function which returns the last character of a given string
function returnLast(str) {
return str.at(-1... | [
-0.8439580202102661,
0.27337831258773804,
-0.3396373987197876,
-0.3190658688545227,
-0.01886243000626564,
-1.6994709968566895,
0.6076464056968689,
-0.2267901599407196,
-0.30727478861808777,
-0.09059573709964752,
0.5596529245376587,
0.361863374710083,
-0.36652079224586487,
0.250518351793289... |
javascript/reference/global_objects/string/at/index.md | JavaScript - Global Objects - String - at - Examples - Comparing methods:
Here we compare different ways to select the penultimate (last but one) character of a `String`. Whilst all below methods are valid, it highlights the succinctness and readability of the `at()` method.
Example:
const myString = "Every green bu... | [
-0.135093554854393,
-0.20523115992546082,
0.23199564218521118,
0.5540631413459778,
0.3082146644592285,
-0.28156566619873047,
0.009427341632544994,
0.03572750836610794,
0.22296711802482605,
0.3337918221950531,
-0.2774662971496582,
-0.3975585401058197,
0.4749089777469635,
-0.2562645077705383... |
javascript/reference/global_objects/string/charcodeat/index.md | JavaScript - Global Objects - String - charCodeAt:
The `charCodeAt()` method of `String` values returns an integer between `0` and `65535` representing the UTF-16 code unit at the given index.
`charCodeAt()` always indexes the string as a sequence of UTF-16 code units, so it may return lone surrogates. To get the ful... | [
-1.069252848625183,
-0.6716087460517883,
-1.2801955938339233,
-0.9240398406982422,
0.3093813359737396,
-1.7951066493988037,
-0.2610621154308319,
0.012564280070364475,
-0.28741466999053955,
-0.4017345607280731,
-0.41168326139450073,
0.34821173548698425,
0.3620133101940155,
0.027903178706765... |
javascript/reference/global_objects/string/charcodeat/index.md | JavaScript - Global Objects - String - charCodeAt - Syntax:
Example:
charCodeAt(index) | [
-0.5629722476005554,
-0.5423822402954102,
-0.7154402136802673,
-0.52027428150177,
-0.5397267937660217,
-1.822900652885437,
-0.021351812407374382,
0.22287242114543915,
-0.3208455443382263,
-0.42215919494628906,
-0.02874559350311756,
-0.14824800193309784,
-0.03762535750865936,
-0.11478265374... |
javascript/reference/global_objects/string/charcodeat/index.md | JavaScript - Global Objects - String - charCodeAt - Syntax - Parameters:
- `index`: Zero-based index of the character to be returned. Converted to an integer — `undefined` is converted to 0. | [
-0.6152739524841309,
0.017238788306713104,
-0.6353781223297119,
-0.1592765748500824,
-0.0158753152936697,
-1.5090080499649048,
0.7178894877433777,
0.12624597549438477,
-0.032154303044080734,
-0.29559126496315,
-0.9903287291526794,
0.13114264607429504,
0.33149099349975586,
0.125425249338150... |
javascript/reference/global_objects/string/charcodeat/index.md | JavaScript - Global Objects - String - charCodeAt - Syntax - Return value:
An integer between `0` and `65535` representing the UTF-16 code unit value of the character at the specified `index`. If `index` is out of range of `0` – `str.length - 1`, `charCodeAt()` returns `NaN`. | [
-0.9438453912734985,
-0.7224038243293762,
-0.6692341566085815,
-0.47764769196510315,
0.01907268725335598,
-1.2126330137252808,
-0.010725686326622963,
0.21743065118789673,
-0.5148436427116394,
-0.16699716448783875,
-0.640894889831543,
0.7336787581443787,
-0.1922561675310135,
-0.365887701511... |
javascript/reference/global_objects/string/charcodeat/index.md | JavaScript - Global Objects - String - charCodeAt - Description:
Characters in a string are indexed from left to right. The index of the first character is `0`, and the index of the last character in a string called `str` is `str.length - 1`.
Unicode code points range from `0` to `1114111` (`0x10FFFF`). `charCodeAt()... | [
-0.9482920169830322,
-0.3805970549583435,
-0.7418035864830017,
-0.8532267808914185,
0.5052174925804138,
-1.3993053436279297,
0.2544037103652954,
-0.5259556174278259,
-0.05883696302771568,
-0.26680973172187805,
-0.30180445313453674,
0.2217215746641159,
-0.7066698670387268,
0.012187973596155... |
javascript/reference/global_objects/string/charcodeat/index.md | JavaScript - Global Objects - String - charCodeAt - Examples - Using charCodeAt():
The following example returns `65`, the Unicode value for A.
Example:
"ABC".charCodeAt(0); // returns 65
`charCodeAt()` may return lone surrogates, which are not valid Unicode characters.
Example:
const str = "𠮷𠮾";
console.log(st... | [
0.12865819036960602,
0.2103612720966339,
-1.153212070465088,
-0.7826398015022278,
0.052821557968854904,
-1.6321591138839722,
-0.0018414902733638883,
0.11677497625350952,
0.011265752837061882,
-0.1914549320936203,
0.01575363799929619,
0.6355680227279663,
0.028513936325907707,
0.268916517496... |
javascript/reference/global_objects/string/padstart/index.md | JavaScript - Global Objects - String - padStart:
The `padStart()` method of `String` values pads this string with a given string (repeated and/or truncated, if needed) so that the resulting string has a given length. The padding is applied from the start of this string.
Example:
const str = "5";
console.log(str.pad... | [
-0.5104262232780457,
-0.10395868122577667,
-1.171734094619751,
-0.07106677442789078,
-0.11851669102907181,
-1.7201179265975952,
1.0270664691925049,
0.5176999568939209,
-0.26257333159446716,
0.5718599557876587,
-1.6956586837768555,
-0.16319452226161957,
-0.8841085433959961,
0.38419198989868... |
javascript/reference/global_objects/string/padstart/index.md | JavaScript - Global Objects - String - padStart - Syntax:
Example:
padStart(targetLength)
padStart(targetLength, padString) | [
-0.5048827528953552,
0.0562191940844059,
-1.328605055809021,
-0.7635218501091003,
-1.0023897886276245,
-1.623936414718628,
0.8001470565795898,
0.9372774958610535,
-0.2677653729915619,
-0.07887232303619385,
-0.8814474940299988,
-0.07087310403585434,
-0.7083805799484253,
-0.1924029439687729,... |
javascript/reference/global_objects/string/padstart/index.md | JavaScript - Global Objects - String - padStart - Syntax - Parameters:
- `targetLength`: The length of the resulting string once the current `str` has been padded. If the value is less than or equal to `str.length`, then `str` is returned as-is.
- `padString` (optional): The string to pad the current `str` with. If `p... | [
-1.9398568868637085,
-0.11617758870124817,
-1.1448410749435425,
-0.8280866146087646,
-0.14658191800117493,
-1.7703408002853394,
0.8688010573387146,
-0.35673871636390686,
-0.32558897137641907,
0.34503480792045593,
-1.1885792016983032,
0.28821665048599243,
-0.34137198328971863,
0.36927023530... |
javascript/reference/global_objects/string/padstart/index.md | JavaScript - Global Objects - String - padStart - Syntax - Return value:
A `String` of the specified `targetLength` with `padString` applied at the start. | [
-0.7545558214187622,
-0.0626748725771904,
-1.4755799770355225,
-0.8146560192108154,
-0.6070903539657593,
-1.205622911453247,
1.0159999132156372,
1.0088303089141846,
-0.5345686078071594,
0.3256843686103821,
-0.9972447156906128,
0.17053860425949097,
-0.48664921522140503,
0.48967278003692627,... |
javascript/reference/global_objects/string/padstart/index.md | JavaScript - Global Objects - String - padStart - Examples - Using String.prototype.padStart():
Example:
"abc".padStart(10); // " abc"
"abc".padStart(10, "foo"); // "foofoofabc"
"abc".padStart(6, "123465"); // "123abc"
"abc".padStart(8, "0"); // "00000abc"
"abc".padStart(1); // "abc" | [
-0.26339301466941833,
0.24094246327877045,
-0.8426381945610046,
-0.8543726801872253,
-0.2603985071182251,
-1.3339961767196655,
1.414433479309082,
0.6434299349784851,
-0.015635814517736435,
0.2915210425853729,
-0.9416244029998779,
-0.35935959219932556,
-0.7327584028244019,
-0.21279196441173... |
javascript/reference/global_objects/string/padstart/index.md | JavaScript - Global Objects - String - padStart - Examples - Fixed width string number conversion:
Example:
// JavaScript version of: (unsigned)
// printf "%0*d" width num
function leftFillNum(num, targetLength) {
return num.toString().padStart(targetLength, "0");
}
const num = 123;
console.log(leftFillNum(num, 5)... | [
-1.0173287391662598,
0.149032324552536,
-1.0812649726867676,
-0.620489239692688,
-0.5645804405212402,
-0.9431684017181396,
1.5355207920074463,
0.4138273596763611,
-0.4073091447353363,
0.16476629674434662,
-1.1197645664215088,
0.1603771597146988,
-0.3972218334674835,
-0.35044848918914795,
... |
javascript/reference/global_objects/string/bold/index.md | JavaScript - Global Objects - String - bold:
Deprecated: This feature is no longer recommended.
The `bold()` method of `String` values creates a string that embeds this string in a `b` element (`<b>str</b>`), which causes this string to be displayed as bold.
Note: All HTML wrapper methods are deprecated and only sta... | [
-0.8003029823303223,
-0.25678399205207825,
-0.1115441843867302,
-0.3293059170246124,
-0.07761992514133453,
-1.7822225093841553,
1.393627405166626,
0.554979145526886,
0.0071401637978851795,
-0.11106754839420319,
-0.4558957815170288,
0.839926540851593,
0.46576663851737976,
-0.403318583965301... |
javascript/reference/global_objects/string/bold/index.md | JavaScript - Global Objects - String - bold - Syntax:
Example:
bold() | [
-0.35484185814857483,
0.34832364320755005,
-0.5711372494697571,
-0.4610194265842438,
-0.4924788475036621,
-1.6231610774993896,
1.180427074432373,
1.0330870151519775,
-0.009827233850955963,
-0.6738485097885132,
-0.4087236225605011,
0.49214601516723633,
-0.5785782337188721,
-0.12113846838474... |
javascript/reference/global_objects/string/bold/index.md | JavaScript - Global Objects - String - bold - Syntax - Parameters:
None. | [
-0.35124269127845764,
0.2776508927345276,
-0.8765004277229309,
-0.6482405066490173,
-0.44706496596336365,
-1.0988460779190063,
1.1264439821243286,
0.9033255577087402,
0.09280623495578766,
-0.38620123267173767,
-0.8161364197731018,
-0.5120081305503845,
-0.18098227679729462,
-0.0204172339290... |
javascript/reference/global_objects/string/bold/index.md | JavaScript - Global Objects - String - bold - Syntax - Return value:
A string beginning with a `<b>` start tag, then the text `str`, and then a `</b>` end tag. | [
-1.06704580783844,
0.23442386090755463,
-0.41709139943122864,
-0.5331881046295166,
-0.15414871275424957,
-0.6642875671386719,
0.7498636841773987,
0.7270326018333435,
-0.12125290930271149,
0.11388586461544037,
-0.5239993929862976,
0.5513312816619873,
-0.3346554934978485,
0.5035434365272522,... |
javascript/reference/global_objects/string/bold/index.md | JavaScript - Global Objects - String - bold - Examples - Using bold():
The code below creates an HTML string and then replaces the document's body with it:
Example:
const contentString = "Hello, world";
document.body.innerHTML = contentString.bold();
This will create the following HTML:
Example:
<b>Hello, world<... | [
-0.441154420375824,
0.3259958326816559,
0.12783071398735046,
0.6241932511329651,
0.028258148580789566,
-2.1244444847106934,
-0.4572327435016632,
-0.3507292866706848,
-0.40340787172317505,
-0.22918136417865753,
-0.26263418793678284,
0.8825737237930298,
-0.12879151105880737,
-0.6638504862785... |
javascript/reference/global_objects/string/symbol.iterator/index.md | JavaScript - Global Objects - String - Symbol.iterator:
The `[Symbol.iterator]()` method of `String` values implements the iterable protocol and allows strings to be consumed by most syntaxes expecting iterables, such as the spread syntax and `for...of` loops. It returns a string iterator object that yields the Unicod... | [
-0.9412265419960022,
-0.11983173340559006,
-0.32388103008270264,
0.1656942218542099,
0.5169752836227417,
-1.6420505046844482,
-0.30720165371894836,
1.1661611795425415,
-0.43483301997184753,
-0.07574906945228577,
-0.7308363318443298,
-0.2536027431488037,
0.0021752724424004555,
0.49209141731... |
javascript/reference/global_objects/string/symbol.iterator/index.md | JavaScript - Global Objects - String - Symbol.iterator - Syntax:
Example:
string[Symbol.iterator]() | [
-0.5876789093017578,
0.07742145657539368,
-0.1593799591064453,
-0.44922682642936707,
-0.17076249420642853,
-2.4842026233673096,
-0.5118075013160706,
1.053989052772522,
0.00769302761182189,
-0.49128982424736023,
-0.2776350677013397,
0.597498893737793,
-0.6773643493652344,
-0.004026909358799... |
javascript/reference/global_objects/string/symbol.iterator/index.md | JavaScript - Global Objects - String - Symbol.iterator - Syntax - Parameters:
None. | [
-0.49388208985328674,
0.15255792438983917,
-0.5169194936752319,
-0.48351767659187317,
-0.2704032361507416,
-1.9660391807556152,
-0.2167275846004486,
1.2848546504974365,
-0.37533578276634216,
-0.5795355439186096,
-0.7212387919425964,
-0.01576797105371952,
-0.2072967141866684,
0.257734507322... |
javascript/reference/global_objects/string/symbol.iterator/index.md | JavaScript - Global Objects - String - Symbol.iterator - Syntax - Return value:
A new iterable iterator object that yields the Unicode code points of the string value as individual strings. | [
-0.48835986852645874,
0.13783429563045502,
-0.6232938170433044,
0.02454604022204876,
-0.0168564822524786,
-1.912358045578003,
-0.21918144822120667,
1.260664701461792,
-0.194008469581604,
-0.041304223239421844,
-0.5747184753417969,
1.0732463598251343,
-0.407187283039093,
1.1693898439407349,... |
javascript/reference/global_objects/string/symbol.iterator/index.md | JavaScript - Global Objects - String - Symbol.iterator - Description:
Strings are iterated by Unicode code points. This means grapheme clusters will be split, but surrogate pairs will be preserved.
Example:
// "Backhand Index Pointing Right: Dark Skin Tone"
[..."👉🏿"]; // ['👉', '🏿']
// splits into the basic "Back... | [
-1.1744091510772705,
0.05387410148978233,
-0.269298791885376,
-0.09096530824899673,
0.3619692623615265,
-2.260437488555908,
0.34893354773521423,
0.4287489652633667,
-0.3230736255645752,
0.4804050624370575,
-0.7963917255401611,
0.9215445518493652,
-0.6562316417694092,
0.6895185112953186,
... |
javascript/reference/global_objects/string/symbol.iterator/index.md | JavaScript - Global Objects - String - Symbol.iterator - Examples - Iteration using for...of loop:
Note that you seldom need to call this method directly. The existence of the `[Symbol.iterator]()` method makes strings iterable, and iterating syntaxes like the `for...of` loop automatically call this method to obtain t... | [
-0.4297235608100891,
0.2750791609287262,
0.16553333401679993,
0.5667414665222168,
0.28486168384552,
-2.0794339179992676,
-0.5707281827926636,
0.21636052429676056,
-0.7131003737449646,
0.03177715465426445,
-0.2055145651102066,
0.09350185096263885,
-0.7020618319511414,
0.5657334923744202,
... |
javascript/reference/global_objects/string/symbol.iterator/index.md | JavaScript - Global Objects - String - Symbol.iterator - Examples - Manually hand-rolling the iterator:
You may still manually call the `next()` method of the returned iterator object to achieve maximum control over the iteration process.
Example:
const str = "A\uD835\uDC68";
const strIter = str[Symbol.iterator]();... | [
-0.5337513089179993,
0.24677912890911102,
-0.755669355392456,
0.21293210983276367,
-0.004186487291008234,
-1.4086894989013672,
-0.7610238194465637,
0.46334826946258545,
-0.6016135811805725,
0.5735119581222534,
-0.22054751217365265,
0.6170844435691833,
-0.11405386030673981,
-0.0831276252865... |
javascript/reference/global_objects/string/towellformed/index.md | JavaScript - Global Objects - String - toWellFormed:
The `toWellFormed()` method of `String` values returns a string where all lone surrogates of this string are replaced with the Unicode replacement character U+FFFD. | [
-1.4348626136779785,
0.6142734885215759,
-0.7527431845664978,
-1.194365382194519,
-0.2770262360572815,
-2.1443893909454346,
0.4592909514904022,
0.2801840901374817,
-0.42411309480667114,
-0.2984904944896698,
-0.7696430683135986,
0.0955161452293396,
-0.08720850944519043,
-0.32968243956565857... |
javascript/reference/global_objects/string/towellformed/index.md | JavaScript - Global Objects - String - toWellFormed - Syntax:
Example:
toWellFormed() | [
-0.7147820591926575,
1.1835142374038696,
-0.31755784153938293,
-0.6499452590942383,
-0.8591526746749878,
-2.1763675212860107,
0.45426198840141296,
0.5337519645690918,
-0.6950880885124207,
-0.3373352289199829,
-0.5595011711120605,
0.06483806669712067,
-0.454744815826416,
-0.3493720293045044... |
javascript/reference/global_objects/string/towellformed/index.md | JavaScript - Global Objects - String - toWellFormed - Syntax - Parameters:
None. | [
-0.5496567487716675,
0.8413774371147156,
-0.6140072345733643,
-0.8053385615348816,
-0.6459833979606628,
-1.8484750986099243,
0.5293948650360107,
0.4574693739414215,
-0.7098755240440369,
-0.3239571452140808,
-0.7822788953781128,
-0.6433359384536743,
-0.03474588692188263,
-0.2569130957126617... |
javascript/reference/global_objects/string/towellformed/index.md | JavaScript - Global Objects - String - toWellFormed - Syntax - Return value:
A new string that is a copy of this string, with all lone surrogates replaced with the Unicode replacement character U+FFFD. If `str` is well formed, a new string is still returned (essentially a copy of `str`). | [
-1.19126558303833,
0.6919403672218323,
-0.4603448212146759,
-0.711753785610199,
-0.023862363770604134,
-1.8675845861434937,
0.5222635865211487,
0.7205319404602051,
-0.10464516282081604,
0.20791557431221008,
-0.8917906880378723,
0.2667553126811981,
-0.4334964156150818,
0.615000307559967,
... |
javascript/reference/global_objects/string/towellformed/index.md | JavaScript - Global Objects - String - toWellFormed - Description:
Strings in JavaScript are UTF-16 encoded. UTF-16 encoding has the concept of surrogate pairs, which is introduced in detail in the UTF-16 characters, Unicode code points, and grapheme clusters section.
`toWellFormed()` iterates through the code units ... | [
-1.2251819372177124,
1.127121925354004,
-0.8137609362602234,
-0.803167462348938,
0.2477700114250183,
-0.9206701517105103,
0.634507417678833,
0.43723997473716736,
-0.1850471794605255,
-0.20604559779167175,
-0.8743790984153748,
0.3180076777935028,
-0.7110373377799988,
-0.733399510383606,
-... |
javascript/reference/global_objects/string/towellformed/index.md | JavaScript - Global Objects - String - toWellFormed - Examples - Using toWellFormed():
Example:
const strings = [
// Lone leading surrogate
"ab\uD800",
"ab\uD800c",
// Lone trailing surrogate
"\uDFFFab",
"c\uDFFFab",
// Well-formed
"abc",
"ab\uD83D\uDE04c",
];
for (const str of strings) {
console... | [
-0.6713083982467651,
1.2560030221939087,
-0.586803674697876,
-0.7574224472045898,
-0.5976687669754028,
-1.4266036748886108,
-0.02366245537996292,
0.13373224437236786,
-0.26714402437210083,
0.1313430666923523,
-0.10166547447443008,
0.010958943516016006,
-0.2195163518190384,
-0.3016463518142... |
javascript/reference/global_objects/string/towellformed/index.md | JavaScript - Global Objects - String - toWellFormed - Examples - Avoiding errors in encodeURI():
`encodeURI` throws an error if the string passed is not well-formed. This can be avoided by using `toWellFormed()` to convert the string to a well-formed string first.
Example:
const illFormed = "https://example.com/sear... | [
-0.01410515047609806,
1.4537628889083862,
-0.6909170746803284,
-0.32601234316825867,
-1.0890593528747559,
-0.8515369892120361,
-0.41196516156196594,
0.12730193138122559,
-1.0191717147827148,
-0.05765343829989433,
-0.6648362874984741,
-0.4862119257450104,
-0.019657175987958908,
-0.561401546... |
javascript/reference/global_objects/string/link/index.md | JavaScript - Global Objects - String - link:
Deprecated: This feature is no longer recommended.
The `link()` method of `String` values creates a string that embeds this string in an `a` element (`<a href="...">str</a>`), to be used as a hypertext link to another URL.
Note: All HTML wrapper methods are deprecated and... | [
-1.4336953163146973,
-0.2535667419433594,
-0.15420189499855042,
0.5972219109535217,
-0.2542908489704132,
-1.6319711208343506,
1.6313291788101196,
0.2865683138370514,
-0.4477158486843109,
-0.4582790434360504,
-0.7524875402450562,
0.8340157270431519,
0.5802299976348877,
-0.3327166438102722,
... |
javascript/reference/global_objects/string/link/index.md | JavaScript - Global Objects - String - link - Syntax:
Example:
link(url) | [
-1.3410484790802002,
-0.02768900990486145,
-0.8516559600830078,
-0.17453880608081818,
-0.9175422191619873,
-1.410967230796814,
0.7591608166694641,
0.7736011743545532,
-0.5232217311859131,
-0.9314659833908081,
-0.6715447306632996,
0.7991423606872559,
-0.1730150431394577,
0.03149718418717384... |
javascript/reference/global_objects/string/link/index.md | JavaScript - Global Objects - String - link - Syntax - Parameters:
- `url`: Any string that specifies the `href` attribute of the `<a>` element; it should be a valid URL (relative or absolute), with any `&` characters escaped as `&`. | [
-1.762264370918274,
0.2753956615924835,
-0.6908411383628845,
-0.08735813945531845,
-0.7439100742340088,
-1.149181842803955,
0.6097391843795776,
0.18829821050167084,
0.08191131055355072,
-0.904620885848999,
-0.9049543738365173,
0.5767928957939148,
-0.30412158370018005,
0.5177620649337769,
... |
javascript/reference/global_objects/string/link/index.md | JavaScript - Global Objects - String - link - Syntax - Return value:
A string beginning with an `<a href="url">` start tag (double quotes in `url` are replaced with `"`), then the text `str`, and then an `</a>` end tag. | [
-2.226938247680664,
0.3767646551132202,
0.030666207894682884,
-0.4286334812641144,
-0.37931615114212036,
-0.9293748736381531,
0.7619004249572754,
0.7411964535713196,
-0.1966867297887802,
-0.35029497742652893,
-0.47964179515838623,
0.7211788892745972,
-0.28009554743766785,
0.149137616157531... |
javascript/reference/global_objects/string/link/index.md | JavaScript - Global Objects - String - link - Examples - Using link():
The code below creates an HTML string and then replaces the document's body with it:
Example:
const contentString = "MDN Web Docs";
document.body.innerHTML = contentString.link("https://developer.mozilla.org/");
This will create the following H... | [
-0.6868119835853577,
-0.1912788450717926,
-0.24086828529834747,
0.28754302859306335,
-0.07019714266061783,
-1.285898208618164,
-0.4539036750793457,
-0.3092138469219208,
-0.8885297775268555,
-0.543471097946167,
-0.13901768624782562,
0.9984948635101318,
-0.40804222226142883,
-0.3150227665901... |
javascript/reference/global_objects/string/localecompare/index.md | JavaScript - Global Objects - String - localeCompare:
The `localeCompare()` method of `String` values returns a number indicating whether this string comes before, or after, or is the same as the given string in sort order. In implementations with `Intl.Collator` API support, this method delegates to `Intl.Collator`.
... | [
-0.8774991035461426,
-0.45590826869010925,
-0.422916054725647,
-0.0496123731136322,
0.08316480368375778,
-1.2837885618209839,
-0.2580707371234894,
0.2721947729587555,
-0.23853668570518494,
0.3666878640651703,
-0.06994380801916122,
0.07828749716281891,
-0.32095131278038025,
0.29050689935684... |
javascript/reference/global_objects/string/localecompare/index.md | JavaScript - Global Objects - String - localeCompare - Syntax:
Example:
localeCompare(compareString)
localeCompare(compareString, locales)
localeCompare(compareString, locales, options) | [
-0.2864169478416443,
0.05476909503340721,
-0.2692309319972992,
-0.4217035472393036,
-0.3816099762916565,
-1.9960460662841797,
0.7874175310134888,
1.0057669878005981,
0.03977183252573013,
-0.592435896396637,
0.05748957023024559,
-0.27719593048095703,
-0.19802765548229218,
-0.095171526074409... |
javascript/reference/global_objects/string/localecompare/index.md | JavaScript - Global Objects - String - localeCompare - 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.Collator` API, these parameters cor... | [
-1.1107656955718994,
0.06727290898561478,
-0.6172208189964294,
0.454748272895813,
-0.030726853758096695,
-1.7374610900878906,
0.5092260837554932,
-0.9314201474189758,
-0.08378235250711441,
0.465503066778183,
-1.00881028175354,
-0.05384476110339165,
0.18450208008289337,
0.5083596110343933,
... |
javascript/reference/global_objects/string/localecompare/index.md | JavaScript - Global Objects - String - localeCompare - Syntax - Return value:
A negative number if `referenceStr` occurs before `compareString`; positive if the `referenceStr` occurs after `compareString`; `0` if they are equivalent.
In implementations with `Intl.Collator`, this is equivalent to `new Intl.Collator(lo... | [
-1.4383540153503418,
-0.026698444038629532,
-0.2860102951526642,
0.29703807830810547,
0.020586993545293808,
-1.504783272743225,
0.11631760746240616,
0.15627798438072205,
-0.85548996925354,
0.7498138546943665,
-0.3713240921497345,
-0.19996586441993713,
0.06155240535736084,
0.183253556489944... |
javascript/reference/global_objects/string/localecompare/index.md | JavaScript - Global Objects - String - localeCompare - Description:
Returns an integer indicating whether the `referenceStr` comes before, after or is equivalent to the `compareString`.
- Negative when the `referenceStr` occurs before `compareString`
- Positive when the `referenceStr` occurs after `compareString`
- R... | [
-1.0572192668914795,
0.06222623586654663,
0.3532809615135193,
-0.046912387013435364,
0.9969163537025452,
-0.7573530077934265,
0.5248349905014038,
0.2283230572938919,
0.06544768810272217,
-0.1887574940919876,
-0.0827709436416626,
0.40436941385269165,
-0.07151240855455399,
-0.096403859555721... |
javascript/reference/global_objects/string/localecompare/index.md | JavaScript - Global Objects - String - localeCompare - Examples - Using localeCompare():
Example:
// The letter "a" is before "c" yielding a negative value
"a".localeCompare("c"); // -2 or -1 (or some other negative value)
// Alphabetically the word "check" comes after "against" yielding a positive value
"check".loc... | [
-0.8423875570297241,
0.26393628120422363,
-0.44263172149658203,
-0.2731550335884094,
0.3500458896160126,
-1.8680874109268188,
0.8213825225830078,
0.8062591552734375,
0.18800441920757294,
-0.38384515047073364,
0.07240068167448044,
0.3307960629463196,
-0.28345635533332825,
-0.158418744802474... |
javascript/reference/global_objects/string/localecompare/index.md | JavaScript - Global Objects - String - localeCompare - Examples - Sort an array:
`localeCompare()` enables case-insensitive sorting for an array.
Example:
const items = ["réservé", "Premier", "Cliché", "communiqué", "café", "Adieu"];
items.sort((a, b) => a.localeCompare(b, "fr", { ignorePunctuation: true }));
// ['A... | [
-0.7098036408424377,
-0.2075781673192978,
-0.037859272211790085,
0.5119344592094421,
0.05024874955415726,
-0.6894068121910095,
0.7584653496742249,
0.5257139801979065,
0.8635458946228027,
0.4491872787475586,
0.28856560587882996,
-0.10812303423881531,
-0.09004449099302292,
0.0150421215221285... |
javascript/reference/global_objects/string/localecompare/index.md | JavaScript - Global Objects - String - localeCompare - Examples - Check browser support for extended arguments:
The `locales` and `options` arguments are not supported in all browsers yet.
To check whether an implementation supports them, use the `"i"` argument (a requirement that illegal language tags are rejected) ... | [
-0.8615216612815857,
0.14050336182117462,
-0.26131361722946167,
-0.033765632659196854,
-0.26661863923072815,
-1.5015830993652344,
0.9372391700744629,
0.4834296405315399,
-0.6886748671531677,
-0.049667391926050186,
-0.4582664370536804,
-0.6773731708526611,
0.14909644424915314,
-0.0909787565... |
javascript/reference/global_objects/string/localecompare/index.md | JavaScript - Global Objects - String - localeCompare - Examples - Using locales:
The results provided by `localeCompare()` vary between languages. In order to get the sort order of the language used in the user interface of your application, make sure to specify that language (and possibly some fallback languages) usi... | [
-0.9593451023101807,
-0.2097974568605423,
-0.6706607341766357,
-0.3858919143676758,
-0.2737424373626709,
-0.8339087963104248,
0.6631791591644287,
-0.22139906883239746,
-0.056381404399871826,
0.21945007145404816,
0.36974161863327026,
0.42097610235214233,
0.17521139979362488,
0.1032558828592... |
javascript/reference/global_objects/string/localecompare/index.md | JavaScript - Global Objects - String - localeCompare - Examples - Using options:
The results provided by `localeCompare()` can be customized using the `options` argument:
Example:
// in German, ä has a as the base letter
console.log("ä".localeCompare("a", "de", { sensitivity: "base" })); // 0
// in Swedish, ä and a... | [
-0.4351676106452942,
-0.013660136610269547,
-0.4813537299633026,
-0.030335284769535065,
0.18769274652004242,
-1.97782564163208,
1.5665626525878906,
0.4057579040527344,
1.3485394716262817,
0.11058368533849716,
-0.0691576823592186,
0.6975767016410828,
0.24487008154392242,
-0.1603242456912994... |
javascript/reference/global_objects/string/localecompare/index.md | JavaScript - Global Objects - String - localeCompare - Examples - Numeric sorting:
Example:
// by default, "2" > "10"
console.log("2".localeCompare("10")); // 1
// numeric using options:
console.log("2".localeCompare("10", undefined, { numeric: true })); // -1
// numeric using locales tag:
console.log("2".localeCom... | [
-0.9583120346069336,
-0.45092952251434326,
-0.30503910779953003,
-0.10408567637205124,
-0.32708004117012024,
-1.311996579170227,
0.48646074533462524,
0.31818264722824097,
-0.14286476373672485,
0.10657979547977448,
0.22681090235710144,
-0.04390902817249298,
-0.8169574737548828,
0.3742750585... |
javascript/reference/global_objects/string/trimend/index.md | JavaScript - Global Objects - String - trimEnd:
The `trimEnd()` method of `String` values removes whitespace from the end of this string and returns a new string, without modifying the original string. `trimRight()` is an alias of this method.
Example:
const greeting = " Hello world! ";
console.log(greeting);
/... | [
-1.218267798423767,
-0.12445572018623352,
-0.38537612557411194,
-0.2388630211353302,
-0.2511984705924988,
-2.587456703186035,
0.20939891040325165,
0.3300333023071289,
-0.14893034100532532,
0.78484708070755,
-1.2101279497146606,
0.08224980533123016,
-0.07850901782512665,
-0.3634629249572754... |
javascript/reference/global_objects/string/trimend/index.md | JavaScript - Global Objects - String - trimEnd - Syntax:
Example:
trimEnd()
trimRight() | [
-0.9561120867729187,
0.3832376003265381,
-0.17064228653907776,
-0.6878242492675781,
-1.3037216663360596,
-2.223451852798462,
0.7869764566421509,
1.2319012880325317,
0.07556400448083878,
-0.04680188000202179,
-1.0138530731201172,
0.5248066782951355,
-0.3153655529022217,
-0.12873508036136627... |
javascript/reference/global_objects/string/trimend/index.md | JavaScript - Global Objects - String - trimEnd - Syntax - Parameters:
None. | [
-1.0409250259399414,
0.21030686795711517,
-0.7556248903274536,
-0.8813062906265259,
-0.7880293726921082,
-1.691789150238037,
1.0284417867660522,
1.2205541133880615,
-0.43258553743362427,
-0.035515040159225464,
-1.0730078220367432,
-0.36502546072006226,
0.004026024602353573,
0.3364051282405... |
javascript/reference/global_objects/string/trimend/index.md | JavaScript - Global Objects - String - trimEnd - Syntax - Return value:
A new string representing `str` stripped of whitespace from its end (right side). Whitespace is defined as white space characters plus line terminators.
If the end of `str` has no whitespace, a new string is still returned (essentially a copy of ... | [
-1.5283020734786987,
-0.1123693436384201,
0.015749288722872734,
-0.7863340973854065,
0.004019497893750668,
-1.3277015686035156,
0.5522066354751587,
1.2172168493270874,
0.5851706266403198,
1.0366169214248657,
-0.5989551544189453,
0.554094672203064,
-0.3634265661239624,
0.326341837644577,
... |
javascript/reference/global_objects/string/trimend/index.md | JavaScript - Global Objects - String - trimEnd - Syntax - Aliasing:
After `trim()` was standardized, engines also implemented the non-standard method `trimRight`. However, for consistency with `padEnd()`, when the method got standardized, its name was chosen as `trimEnd`. For web compatibility reasons, `trimRight` rem... | [
-0.9769376516342163,
-0.38380366563796997,
-1.045799732208252,
-0.3478719890117645,
-1.0099834203720093,
-2.1777703762054443,
1.054897427558899,
1.2405650615692139,
-0.37824150919914246,
0.42675724625587463,
-0.9570059180259705,
-0.25313249230384827,
0.10792721062898636,
-0.026270482689142... |
javascript/reference/global_objects/string/trimend/index.md | JavaScript - Global Objects - String - trimEnd - Examples - Using trimEnd():
The following example trims whitespace from the end of `str`, but not from its start.
Example:
let str = " foo ";
console.log(str.length); // 8
str = str.trimEnd();
console.log(str.length); // 6
console.log(str); // ' foo' | [
-1.058030605316162,
0.16171211004257202,
-0.23662151396274567,
-0.6202977299690247,
-0.5251795649528503,
-1.5022677183151245,
0.722240686416626,
0.8021284341812134,
-0.35186895728111267,
0.7593526840209961,
-0.27871859073638916,
0.15413664281368256,
-0.766167938709259,
-0.552803099155426,
... |
javascript/reference/global_objects/string/fixed/index.md | JavaScript - Global Objects - String - fixed:
Deprecated: This feature is no longer recommended.
The `fixed()` method of `String` values creates a string that embeds this string in a `tt` element (`<tt>str</tt>`), which causes this string to be displayed in a fixed-width font.
Note: All HTML wrapper methods are depr... | [
-1.5030076503753662,
-0.4481339454650879,
-0.6478009223937988,
-0.1448942869901657,
0.16995933651924133,
-1.988023281097412,
1.3411026000976562,
1.1422680616378784,
-0.13924020528793335,
0.33256855607032776,
-0.17051447927951813,
0.5776920914649963,
0.21015919744968414,
-0.2668842971324920... |
javascript/reference/global_objects/string/fixed/index.md | JavaScript - Global Objects - String - fixed - Syntax:
Example:
fixed() | [
-0.04491444677114487,
-0.1095358356833458,
-1.0102494955062866,
-0.22466076910495758,
-0.5574946999549866,
-2.3067517280578613,
1.195273756980896,
1.5674508810043335,
-0.11675906926393509,
-0.14237965643405914,
-0.18234749138355255,
0.1076648011803627,
-0.31971871852874756,
0.0915148854255... |
javascript/reference/global_objects/string/fixed/index.md | JavaScript - Global Objects - String - fixed - Syntax - Parameters:
None. | [
-0.3961372673511505,
0.24448645114898682,
-1.0652897357940674,
-0.6604928374290466,
-0.6150422096252441,
-1.9628610610961914,
1.0796616077423096,
1.2669830322265625,
-0.25922077894210815,
-0.3689349591732025,
-0.7261484861373901,
-0.6359245777130127,
-0.21746493875980377,
0.173866838216781... |
javascript/reference/global_objects/string/fixed/index.md | JavaScript - Global Objects - String - fixed - Syntax - Return value:
A string beginning with a `<tt>` start tag, then the text `str`, and then a `</tt>` end tag. | [
-0.9403418302536011,
0.2518933117389679,
-0.45792239904403687,
-0.071613609790802,
0.08021553605794907,
-1.2065509557724,
0.3624788224697113,
0.9915022850036621,
-0.27312949299812317,
0.26951995491981506,
-0.32336634397506714,
0.2852882146835327,
-0.42444896697998047,
0.5958343148231506,
... |
javascript/reference/global_objects/string/fixed/index.md | JavaScript - Global Objects - String - fixed - Examples - Using fixed():
The code below creates an HTML string and then replaces the document's body with it:
Example:
const contentString = "Hello, world";
document.body.innerHTML = contentString.fixed();
This will create the following HTML:
Example:
<tt>Hello, wo... | [
-0.8875609636306763,
-0.11502576619386673,
0.08591143041849136,
0.9114652872085571,
0.4575217366218567,
-2.343536853790283,
0.026888668537139893,
0.2939760684967041,
-0.7776281237602234,
0.24546703696250916,
-0.37607768177986145,
0.1357627511024475,
-0.3651350736618042,
-0.5440055727958679... |
javascript/reference/global_objects/string/normalize/index.md | JavaScript - Global Objects - String - normalize:
The `normalize()` method of `String` values returns the Unicode Normalization Form of this string.
Example:
const name1 = "\u0041\u006d\u00e9\u006c\u0069\u0065";
const name2 = "\u0041\u006d\u0065\u0301\u006c\u0069\u0065";
console.log(`${name1}, ${name2}`);
// Expect... | [
-0.5150578618049622,
-0.2169404774904251,
-1.0065470933914185,
0.187062606215477,
-0.353362500667572,
-1.7564724683761597,
-0.14814043045043945,
0.14041845500469208,
0.35261210799217224,
0.2547427713871002,
-0.9758475422859192,
-0.2419898360967636,
0.11979889869689941,
-0.3117336630821228,... |
javascript/reference/global_objects/string/normalize/index.md | JavaScript - Global Objects - String - normalize - Syntax:
Example:
normalize()
normalize(form) | [
-0.682972252368927,
0.7490074038505554,
-0.8689118027687073,
-0.4016192853450775,
-0.8388200402259827,
-1.25142240524292,
0.7711277008056641,
1.177992582321167,
0.4745907485485077,
-0.47695192694664,
-0.8402395844459534,
-0.06975622475147247,
-0.04420718550682068,
0.07826060056686401,
0.... |
javascript/reference/global_objects/string/normalize/index.md | JavaScript - Global Objects - String - normalize - Syntax - Parameters:
- `form` (optional): One of `"NFC"`, `"NFD"`, `"NFKC"`, or `"NFKD"`, specifying the Unicode Normalization Form. If omitted or `undefined`, `"NFC"` is used. These values have the following meanings: - `"NFC"`: Canonical Decomposition, followed by ... | [
-0.6501662135124207,
-0.2688833475112915,
-1.3642457723617554,
-0.4728071689605713,
-0.05113784223794937,
-2.24568247795105,
1.0978193283081055,
0.2917443513870239,
0.9541025757789612,
0.895488440990448,
-0.8124845027923584,
-0.5221878290176392,
-0.2560819983482361,
1.169377088546753,
0.... |
javascript/reference/global_objects/string/normalize/index.md | JavaScript - Global Objects - String - normalize - Syntax - Return value:
A string containing the Unicode Normalization Form of the given string. | [
-0.729856550693512,
0.09561558812856674,
-0.7296792268753052,
-0.2257598638534546,
-0.5466681718826294,
-1.0785268545150757,
0.7827368974685669,
1.1988283395767212,
0.5414259433746338,
-0.14596158266067505,
-1.023239016532898,
0.8337773680686951,
-0.06333435326814651,
1.075049877166748,
... |
javascript/reference/global_objects/string/normalize/index.md | JavaScript - Global Objects - String - normalize - Syntax - Exceptions:
- `RangeError`: Thrown if `form` isn't one of the values specified above. | [
-1.4033067226409912,
0.36836865544319153,
-0.9147269129753113,
0.05592812970280647,
-0.7702019810676575,
-1.7965575456619263,
0.1206018328666687,
1.0745749473571777,
-0.6335017085075378,
-0.3992171287536621,
-0.5167149901390076,
-0.17131711542606354,
-0.24571755528450012,
-0.18068286776542... |
javascript/reference/global_objects/string/normalize/index.md | JavaScript - Global Objects - String - normalize - Description:
Unicode assigns a unique numerical value, called a code point, to each character. For example, the code point for `"A"` is given as U+0041. However, sometimes more than one code point, or sequence of code points, can represent the same abstract character ... | [
-0.8832881450653076,
-0.216022327542305,
-1.2590737342834473,
-0.7724260091781616,
0.12830957770347595,
-1.4421409368515015,
0.6671138405799866,
0.14445804059505463,
0.5272347331047058,
-0.07660846412181854,
-0.7848587036132812,
0.3341716527938843,
-0.16934926807880402,
-0.0274895075708627... |
javascript/reference/global_objects/string/normalize/index.md | JavaScript - Global Objects - String - normalize - Description - Canonical equivalence normalization:
In Unicode, two sequences of code points have canonical equivalence if they represent the same abstract characters, and should always have the same visual appearance and behavior (for example, they should always be so... | [
-1.1774916648864746,
0.002886967035010457,
-0.788465142250061,
-0.5089264512062073,
0.2800256311893463,
-1.5963515043258667,
0.7065426111221313,
0.5875551700592041,
0.590837836265564,
0.4098171591758728,
-0.6031846404075623,
-0.4846445620059967,
0.07796939462423325,
0.16448518633842468,
... |
javascript/reference/global_objects/string/normalize/index.md | JavaScript - Global Objects - String - normalize - Description - Canonical equivalence normalization - Composed and decomposed forms:
Note that the length of the normalized form under `"NFD"` is `2`. That's because `"NFD"` gives you the decomposed version of the canonical form, in which single code points are split in... | [
-0.28115367889404297,
-0.7598567008972168,
-1.2085280418395996,
-0.8172324299812317,
0.17640084028244019,
-2.1614418029785156,
0.8040609359741211,
0.23826876282691956,
0.11729653924703598,
0.5750500559806824,
-0.6114333271980286,
-0.5959686040878296,
-0.7524901032447815,
0.5905842185020447... |
javascript/reference/global_objects/string/normalize/index.md | JavaScript - Global Objects - String - normalize - Description - Compatibility normalization:
In Unicode, two sequences of code points are compatible if they represent the same abstract characters, and should be treated alike in some — but not necessarily all — applications.
All canonically equivalent sequences are a... | [
-0.40112730860710144,
-0.04980380833148956,
-0.6854214072227478,
0.33723869919776917,
0.6877883076667786,
-0.9794958829879761,
0.6612290740013123,
0.5281218886375427,
0.17129644751548767,
-0.2999373972415924,
-0.6252951622009277,
-0.14184832572937012,
-0.29319483041763306,
0.13838452100753... |
javascript/reference/global_objects/string/normalize/index.md | JavaScript - Global Objects - String - normalize - Examples - Using normalize():
Example:
// Initial string
// U+1E9B: LATIN SMALL LETTER LONG S WITH DOT ABOVE
// U+0323: COMBINING DOT BELOW
const str = "\u1E9B\u0323";
// Canonically-composed form (NFC)
// U+1E9B: LATIN SMALL LETTER LONG S WITH DOT ABOVE
// U+0323... | [
-0.10223422199487686,
0.04106184095144272,
-0.4213959872722626,
0.33080896735191345,
0.5218263268470764,
-0.7753504514694214,
0.26353347301483154,
0.7604180574417114,
-0.5455061197280884,
-0.02457127533853054,
-0.7082670331001282,
-0.6587430834770203,
-0.7404376268386841,
0.184077218174934... |
javascript/reference/global_objects/string/sub/index.md | JavaScript - Global Objects - String - sub:
Deprecated: This feature is no longer recommended.
The `sub()` method of `String` values creates a string that embeds this string in a `sub` element (`<sub>str</sub>`), which causes this string to be displayed as subscript.
Note: All HTML wrapper methods are deprecated and... | [
-1.2532541751861572,
-0.911130428314209,
-0.29465585947036743,
0.24884846806526184,
-0.2016678899526596,
-1.6899466514587402,
1.0955430269241333,
0.25145378708839417,
-0.51984703540802,
-0.16374890506267548,
-0.5309091210365295,
0.40923795104026794,
0.7168458700180054,
-0.3699481189250946,... |
javascript/reference/global_objects/string/sub/index.md | JavaScript - Global Objects - String - sub - Syntax:
Example:
sub() | [
-0.9352145195007324,
-0.551925539970398,
-1.0672396421432495,
0.15703442692756653,
-0.48521921038627625,
-1.900496482849121,
0.9563701152801514,
0.7847446203231812,
-0.4713943898677826,
-0.5832915306091309,
-0.5186680555343628,
0.04489145427942276,
-0.23474381864070892,
-0.0091815618798136... |
javascript/reference/global_objects/string/sub/index.md | JavaScript - Global Objects - String - sub - Syntax - Parameters:
None. | [
-0.70054030418396,
0.019362861290574074,
-0.9827168583869934,
-0.36795079708099365,
-0.471821665763855,
-1.536118507385254,
0.7986338138580322,
0.7129405736923218,
-0.4980589747428894,
-0.7588464021682739,
-0.9775862693786621,
-0.7844495177268982,
-0.08461417257785797,
0.19557487964630127,... |
javascript/reference/global_objects/string/sub/index.md | JavaScript - Global Objects - String - sub - Syntax - Return value:
A string beginning with a `<sub>` start tag, then the text `str`, and then a `</sub>` end tag. | [
-1.4279018640518188,
-0.06136607006192207,
-0.39519205689430237,
-0.23810265958309174,
-0.26992666721343994,
-0.8221769332885742,
0.5539498329162598,
0.6204026341438293,
-0.6278877258300781,
-0.08719027042388916,
-0.5814898610115051,
0.27300047874450684,
-0.29900631308555603,
0.61638164520... |
javascript/reference/global_objects/string/sub/index.md | JavaScript - Global Objects - String - sub - Examples - Using sub():
The code below creates an HTML string and then replaces the document's body with it:
Example:
const contentString = "Hello, world";
document.body.innerHTML = contentString.sub();
This will create the following HTML:
Example:
<sub>Hello, world</... | [
-0.7180225849151611,
-0.2626456618309021,
0.14142972230911255,
0.919281542301178,
-0.0695430114865303,
-2.098706007003784,
-0.7398524880409241,
-0.5633736252784729,
-0.8498889803886414,
-0.0289600919932127,
-0.2689303457736969,
0.4563944637775421,
0.012613680213689804,
-0.6009618639945984,... |
javascript/reference/global_objects/string/substring/index.md | JavaScript - Global Objects - String - substring:
The `substring()` method of `String` values returns the part of this string from the start index up to and excluding the end index, or to the end of the string if no end index is supplied.
Example:
const str = "Mozilla";
console.log(str.substring(1, 3));
// Expected... | [
-1.549013376235962,
-0.6084157228469849,
-0.5790813565254211,
0.41152089834213257,
-0.06641819328069687,
-1.714162826538086,
0.7368841767311096,
0.0043324739672243595,
-0.5271486639976501,
-0.336453378200531,
-0.3410826027393341,
0.0034730080515146255,
-0.005413300357758999,
0.090991675853... |
javascript/reference/global_objects/string/substring/index.md | JavaScript - Global Objects - String - substring - Syntax:
Example:
substring(indexStart)
substring(indexStart, indexEnd) | [
-0.5583844780921936,
-0.4263607859611511,
-0.607464075088501,
0.07533540576696396,
-0.6451405882835388,
-1.9612752199172974,
0.6992510557174683,
0.5179094672203064,
0.03899634629487991,
-0.8434116244316101,
-0.8654883503913879,
-0.386222779750824,
-0.5154409408569336,
0.09468823671340942,
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.