file stringlengths 16 94 | text stringlengths 32 24.4k | vector list |
|---|---|---|
javascript/reference/global_objects/string/substring/index.md | JavaScript - Global Objects - String - substring - Syntax - Parameters:
- `indexStart`: The index of the first character to include in the returned substring.
- `indexEnd` (optional): The index of the first character to exclude from the returned substring. | [
-0.911917507648468,
-0.5832588076591492,
-0.4340206980705261,
-0.029652191326022148,
-0.14773263037204742,
-1.8703619241714478,
1.3537064790725708,
-0.4160485863685608,
0.5772180557250977,
-0.16076698899269104,
-1.2790285348892212,
-0.18279717862606049,
-0.39756089448928833,
0.152189552783... |
javascript/reference/global_objects/string/substring/index.md | JavaScript - Global Objects - String - substring - Syntax - Return value:
A new string containing the specified part of the given string. | [
-0.6165866255760193,
-0.47645801305770874,
-0.5596421957015991,
0.1284147948026657,
-0.5174298286437988,
-1.7570701837539673,
1.083728551864624,
0.8415570855140686,
0.16421496868133545,
-0.17863671481609344,
-0.7498605847358704,
0.3940340578556061,
-0.5232500433921814,
1.50099515914917,
... |
javascript/reference/global_objects/string/substring/index.md | JavaScript - Global Objects - String - substring - Description:
`substring()` extracts characters from `indexStart` up to but not including `indexEnd`. In particular:
- If `indexEnd` is omitted or `undefined`, `substring()` extracts characters to the end of the string.
- If `indexStart` is equal to `indexEnd`, `subst... | [
-1.7611784934997559,
-0.6103081107139587,
-0.5318247079849243,
0.694918155670166,
0.00018773780902847648,
-2.662431001663208,
1.8369073867797852,
0.23190844058990479,
-0.18945206701755524,
0.00031148502603173256,
-0.8325528502464294,
-0.2758832573890686,
-0.6314408183097839,
-0.23471371829... |
javascript/reference/global_objects/string/substring/index.md | JavaScript - Global Objects - String - substring - Examples - Using substring():
The following example uses `substring()` to display characters from the string `"Mozilla"`:
Example:
const anyString = "Mozilla";
console.log(anyString.substring(0, 1)); // "M"
console.log(anyString.substring(1, 0)); // "M"
console.lo... | [
-0.668695867061615,
-0.2869624197483063,
-0.835363507270813,
0.043636590242385864,
-0.282782644033432,
-1.734286904335022,
0.670182466506958,
-0.09903662651777267,
-0.02982202172279358,
-0.3777112066745758,
-0.18634137511253357,
-0.04113493487238884,
-0.16034424304962158,
-0.50925135612487... |
javascript/reference/global_objects/string/substring/index.md | JavaScript - Global Objects - String - substring - Examples - Using substring() with length property:
The following example uses the `substring()` method and `length` property to extract the last characters of a particular string. This method may be easier to remember, given that you don't need to know the starting an... | [
-0.8237615823745728,
-0.23669494688510895,
-0.1826842576265335,
0.4558815658092499,
-0.5916347503662109,
-2.048956871032715,
1.047263264656067,
-0.5245288014411926,
-0.1653086245059967,
-0.31330379843711853,
-0.8024300336837769,
0.30831876397132874,
-0.46953171491622925,
-0.138752639293670... |
javascript/reference/global_objects/string/substring/index.md | JavaScript - Global Objects - String - substring - Examples - The difference between substring() and substr():
There are subtle differences between the `substring()` and `substr()` methods, so you should be careful not to get them confused.
- The two parameters of `substr()` are `start` and `length`, while for `subst... | [
-1.5064575672149658,
-0.33017635345458984,
-0.9823963642120361,
0.407595157623291,
0.21826107800006866,
-1.8330953121185303,
0.8320043683052063,
0.5552507638931274,
0.16728545725345612,
0.023437730967998505,
-0.42143216729164124,
-0.06529758125543594,
-0.09275752305984497,
-0.1424517333507... |
javascript/reference/global_objects/string/substring/index.md | JavaScript - Global Objects - String - substring - Examples - Differences between substring() and slice():
The `substring()` and `slice()` methods are almost identical, but there are a couple of subtle differences between the two, especially in the way negative arguments are dealt with.
The `substring()` method swaps... | [
-0.48585474491119385,
-0.6837913393974304,
-0.43110549449920654,
1.4598495960235596,
0.7239041924476624,
-1.199630856513977,
1.3362332582473755,
0.6800798177719116,
-0.639556348323822,
0.8909664750099182,
-0.4507279694080353,
-0.9199219346046448,
0.080875463783741,
0.11610838025808334,
0... |
javascript/reference/global_objects/string/substring/index.md | JavaScript - Global Objects - String - substring - Examples - Replacing a substring within a string:
The following example replaces a substring within a string. It will replace both individual characters and substrings. The function call at the end of the example creates a string `Brave New Web` from the original stri... | [
0.03780754655599594,
0.4052239656448364,
-0.377481609582901,
0.8668438196182251,
0.721329927444458,
-2.0581552982330322,
1.0304287672042847,
0.4982334077358246,
-0.9120658040046692,
0.5729908347129822,
-0.5412582755088806,
-0.13150303065776825,
-0.5990670919418335,
0.18608349561691284,
0... |
javascript/reference/global_objects/string/valueof/index.md | JavaScript - Global Objects - String - valueOf:
The `valueOf()` method of `String` values returns this string value.
Example:
const stringObj = new String("foo");
console.log(stringObj);
// Expected output: String { "foo" }
console.log(stringObj.valueOf());
// Expected output: "foo" | [
-0.9893615245819092,
-0.45208919048309326,
-0.8588229417800903,
0.058034658432006836,
-0.033151738345623016,
-1.7290596961975098,
0.0372968465089798,
0.3648729622364044,
0.03175422549247742,
-0.23089797794818878,
-0.6534956097602844,
0.1399393379688263,
0.3392956554889679,
0.42427790164947... |
javascript/reference/global_objects/string/valueof/index.md | JavaScript - Global Objects - String - valueOf - Syntax:
Example:
valueOf() | [
-0.2888443171977997,
-0.18730688095092773,
-0.38814231753349304,
-0.1984717696905136,
-0.3811245560646057,
-1.7373757362365723,
0.9145464301109314,
1.033348560333252,
0.34767115116119385,
-0.9236598610877991,
-0.5555950999259949,
0.36311012506484985,
-0.2374020367860794,
0.1615954041481018... |
javascript/reference/global_objects/string/valueof/index.md | JavaScript - Global Objects - String - valueOf - Syntax - Parameters:
None. | [
-0.4580100178718567,
0.11702025681734085,
-0.7931592464447021,
-0.4117165803909302,
-0.4190627634525299,
-1.508737564086914,
1.0036306381225586,
0.9081823229789734,
-0.10719813406467438,
-0.9219198226928711,
-0.9041247367858887,
-0.629407525062561,
-0.11590394377708435,
0.09447742253541946... |
javascript/reference/global_objects/string/valueof/index.md | JavaScript - Global Objects - String - valueOf - Syntax - Return value:
A string representing the primitive value of a given `String` object. | [
-0.7211049795150757,
0.033199530094861984,
-0.3549852669239044,
-0.3190600574016571,
-0.41070839762687683,
-1.5719565153121948,
1.2002606391906738,
0.9923567771911621,
0.20634964108467102,
-0.1476431041955948,
-0.9648849964141846,
0.550351083278656,
-0.6732857823371887,
1.002384901046753,
... |
javascript/reference/global_objects/string/valueof/index.md | JavaScript - Global Objects - String - valueOf - Description:
The `valueOf()` method of `String` returns the primitive value of a `String` object as a string data type. This value is equivalent to `String.prototype.toString()`.
This method is usually called internally by JavaScript and not explicitly in code. | [
-1.3149149417877197,
-0.3343493640422821,
-0.5349647402763367,
0.1307922750711441,
0.3292074501514435,
-1.5763095617294312,
1.2394261360168457,
0.6657741069793701,
0.07298701256513596,
-0.21037788689136505,
-0.8731029033660889,
0.43622076511383057,
0.08029814064502716,
0.13161823153495789,... |
javascript/reference/global_objects/string/valueof/index.md | JavaScript - Global Objects - String - valueOf - Examples - Using `valueOf()`:
Example:
const x = new String("Hello world");
console.log(x.valueOf()); // 'Hello world' | [
-0.6651828289031982,
-0.25239333510398865,
-0.6448607444763184,
0.8957155346870422,
-0.34353846311569214,
-1.4249193668365479,
-0.0643058493733406,
-0.23166392743587494,
0.4989824891090393,
-0.499898225069046,
-0.6778610944747925,
-0.1898443102836609,
0.3456890881061554,
0.0384799428284168... |
javascript/reference/global_objects/string/search/index.md | JavaScript - Global Objects - String - search:
The `search()` method of `String` values executes a search for a match between a regular expression and this string, returning the index of the first match in the string.
Example:
const paragraph = "I think Ruth's dog is cuter than your dog!";
// Anything not a word ch... | [
-1.4834612607955933,
-0.7711499929428101,
-0.8752133250236511,
0.040519773960113525,
0.007403916213661432,
-0.6531606316566467,
0.18509459495544434,
-0.09062692523002625,
0.5058518052101135,
-0.27231916785240173,
-0.9698273539543152,
-0.42916497588157654,
-0.07442086189985275,
-0.035179886... |
javascript/reference/global_objects/string/search/index.md | JavaScript - Global Objects - String - search - Syntax:
Example:
search(regexp) | [
-0.9617276787757874,
0.20633374154567719,
-0.5804116725921631,
-0.771787166595459,
-0.8967013359069824,
-0.9768829345703125,
0.0744062066078186,
0.4047279953956604,
0.02476160228252411,
-0.5727054476737976,
-0.5887237787246704,
-0.5119600892066956,
-0.26806142926216125,
0.13929647207260132... |
javascript/reference/global_objects/string/search/index.md | JavaScript - Global Objects - String - search - Syntax - Parameters:
- `regexp`: A regular expression object, or any object that has a `Symbol.search` method. If `regexp` is not a `RegExp` object and does not have a `Symbol.search` method, it is implicitly converted to a `RegExp` by using `new RegExp(regexp)`. | [
-0.6763887405395508,
-0.12379999458789825,
-0.49034568667411804,
-0.5347930192947388,
-0.7971215844154358,
-0.9723294973373413,
-0.057801488786935806,
0.799419641494751,
0.811288595199585,
-0.8525456190109253,
-0.9026468396186829,
-0.5087351202964783,
0.0719311460852623,
0.4940381348133087... |
javascript/reference/global_objects/string/search/index.md | JavaScript - Global Objects - String - search - Syntax - Return value:
The index of the first match between the regular expression and the given string, or `-1` if no match was found. | [
-0.553114652633667,
-0.17806705832481384,
-0.7221803665161133,
-0.010621690191328526,
-0.19205410778522491,
-0.36471623182296753,
1.4783930778503418,
0.7782233953475952,
0.03386792540550232,
-0.6077207922935486,
-0.8427973985671997,
-0.14386552572250366,
-0.18135640025138855,
0.70893722772... |
javascript/reference/global_objects/string/search/index.md | JavaScript - Global Objects - String - search - Description:
The implementation of `String.prototype.search()` doesn't do much other than calling the `Symbol.search` method of the argument with the string as the first parameter. The actual implementation comes from `RegExp.prototype[Symbol.search]()`.
The `g` flag of... | [
-1.3415380716323853,
0.04431242123246193,
-0.43298035860061646,
-0.32417869567871094,
-0.23097655177116394,
-0.913357138633728,
0.8434104323387146,
0.1952958106994629,
0.01194409467279911,
-0.42047688364982605,
-1.2707996368408203,
-0.7163660526275635,
0.30557239055633545,
-0.0739967077970... |
javascript/reference/global_objects/string/search/index.md | JavaScript - Global Objects - String - search - Examples - Using search():
The following example searches a string with two different regex objects to show a successful search (positive value) vs. an unsuccessful search (`-1`).
Example:
const str = "hey JudE";
const re = /[A-Z]/;
const reDot = /[.]/;
console.log(str... | [
-1.2836228609085083,
0.27484411001205444,
-0.4465043246746063,
0.5871245265007019,
0.3875090479850769,
-0.06907029449939728,
0.644720196723938,
-0.06856769323348999,
-0.3053806722164154,
-0.13048028945922852,
-0.6858407258987427,
-0.5616419911384583,
-0.1439545452594757,
-0.435417950153350... |
javascript/reference/global_objects/string/trim/index.md | JavaScript - Global Objects - String - trim:
The `trim()` method of `String` values removes whitespace from both ends of this string and returns a new string, without modifying the original string.
To return a new string with whitespace trimmed from just one end, use `trimStart()` or `trimEnd()`.
Example:
const gre... | [
-1.0574605464935303,
-0.0787111222743988,
-0.24015218019485474,
-0.48398712277412415,
-0.04379596561193466,
-2.161362409591675,
0.3350246846675873,
0.38359302282333374,
-0.48621341586112976,
1.307116985321045,
-0.9003973603248596,
0.40349411964416504,
-0.06526613980531693,
-0.2092516720294... |
javascript/reference/global_objects/string/trim/index.md | JavaScript - Global Objects - String - trim - Syntax:
Example:
trim() | [
-0.944058895111084,
-0.06604292243719101,
-0.5318188071250916,
-0.4524766504764557,
-0.9053667783737183,
-2.035327911376953,
0.7518451809883118,
0.9668653011322021,
-0.3085528314113617,
0.25693997740745544,
-0.9526417851448059,
0.5284591317176819,
-0.583648145198822,
0.36083585023880005,
... |
javascript/reference/global_objects/string/trim/index.md | JavaScript - Global Objects - String - trim - Syntax - Parameters:
None. | [
-0.8443914651870728,
0.180417001247406,
-0.7562965750694275,
-0.6493126749992371,
-0.5380252599716187,
-1.6077913045883179,
0.8611862063407898,
1.0469223260879517,
-0.40568697452545166,
-0.033533189445734024,
-1.1284050941467285,
-0.39511433243751526,
-0.2991899251937866,
0.471746236085891... |
javascript/reference/global_objects/string/trim/index.md | JavaScript - Global Objects - String - trim - Syntax - Return value:
A new string representing `str` stripped of whitespace from both its beginning and end. Whitespace is defined as white space characters plus line terminators.
If neither the beginning or end of `str` has any whitespace, a new string is still returne... | [
-1.220128059387207,
-0.0768718495965004,
-0.023612722754478455,
-0.5445895791053772,
0.24956396222114563,
-1.4326757192611694,
0.46835607290267944,
0.9398503303527832,
0.39689093828201294,
0.9918954372406006,
-0.7210904955863953,
0.4354565143585205,
-0.5634013414382935,
0.464273601770401,
... |
javascript/reference/global_objects/string/trim/index.md | JavaScript - Global Objects - String - trim - Examples - Using trim():
The following example trims whitespace from both ends of `str`.
Example:
const str = " foo ";
console.log(str.trim()); // 'foo' | [
-0.8814919590950012,
0.15842637419700623,
-0.19654791057109833,
-0.24120163917541504,
-0.3781787157058716,
-1.510782241821289,
0.7765655517578125,
0.44029322266578674,
-0.11920466274023056,
1.206065058708191,
-0.5247054696083069,
0.20560690760612488,
-0.655624270439148,
-0.1820874363183975... |
javascript/reference/global_objects/string/sup/index.md | JavaScript - Global Objects - String - sup:
Deprecated: This feature is no longer recommended.
The `sup()` method of `String` values creates a string that embeds this string in a `sup` element (`<sup>str</sup>`), which causes this string to be displayed as superscript.
Note: All HTML wrapper methods are deprecated a... | [
-1.2296749353408813,
-0.8217344284057617,
-0.40777841210365295,
0.10289928317070007,
-0.07387829571962357,
-1.6883054971694946,
0.9588136076927185,
0.5981941223144531,
-0.42091938853263855,
-0.17915339767932892,
-0.405088871717453,
0.7995761632919312,
0.555051863193512,
-0.4074712991714477... |
javascript/reference/global_objects/string/sup/index.md | JavaScript - Global Objects - String - sup - Syntax:
Example:
sup() | [
-1.0178005695343018,
-0.3521845042705536,
-1.2725138664245605,
-0.3338718116283417,
-0.7542266845703125,
-1.7841957807540894,
0.7683603167533875,
1.1276601552963257,
-0.18701431155204773,
-0.3070821166038513,
-0.14802779257297516,
0.5010814666748047,
-0.3039490282535553,
-0.233646720647811... |
javascript/reference/global_objects/string/sup/index.md | JavaScript - Global Objects - String - sup - Syntax - Parameters:
None. | [
-0.943867564201355,
0.05244879052042961,
-1.1951719522476196,
-0.8021780848503113,
-0.47610020637512207,
-1.405409336090088,
0.7560507655143738,
1.1449222564697266,
-0.29497456550598145,
-0.5360879302024841,
-0.7086073756217957,
-0.43688422441482544,
-0.15103454887866974,
-0.06329114735126... |
javascript/reference/global_objects/string/sup/index.md | JavaScript - Global Objects - String - sup - Syntax - Return value:
A string beginning with a `<sup>` start tag, then the text `str`, and then a `</sup>` end tag. | [
-1.4693905115127563,
-0.03520591929554939,
-0.4661886692047119,
-0.5010517239570618,
-0.2772877812385559,
-0.9053905010223389,
0.3552131950855255,
0.9818950295448303,
-0.4346158504486084,
0.011416858062148094,
-0.40618783235549927,
0.5903154611587524,
-0.2577838897705078,
0.439365059137344... |
javascript/reference/global_objects/string/sup/index.md | JavaScript - Global Objects - String - sup - Examples - Using sup():
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.sup();
This will create the following HTML:
Example:
<sup>Hello, world</... | [
-0.9313043355941772,
-0.21465997397899628,
0.012430147267878056,
0.5971623063087463,
0.001725891837850213,
-2.152221202850342,
-0.6533217430114746,
-0.13841792941093445,
-0.6909207105636597,
0.07753784209489822,
-0.014091486111283302,
0.6346064805984497,
-0.01678723655641079,
-0.6711343526... |
javascript/reference/global_objects/string/fromcodepoint/index.md | JavaScript - Global Objects - String - fromCodePoint:
The `String.fromCodePoint()` static method returns a string created from the specified sequence of code points.
Example:
console.log(String.fromCodePoint(9731, 9733, 9842, 0x2f804));
// Expected output: "☃★♲你" | [
-0.6272562146186829,
-0.5943289995193481,
-1.0485366582870483,
-0.8034351468086243,
0.3090769052505493,
-2.2846736907958984,
0.46127849817276,
0.02326003648340702,
-0.8018299341201782,
0.10526823997497559,
-0.8906139731407166,
-0.31006956100463867,
0.32558709383010864,
0.2562861144542694,
... |
javascript/reference/global_objects/string/fromcodepoint/index.md | JavaScript - Global Objects - String - fromCodePoint - Syntax:
Example:
String.fromCodePoint()
String.fromCodePoint(num1)
String.fromCodePoint(num1, num2)
String.fromCodePoint(num1, num2, /* …, */ numN) | [
-0.35892602801322937,
-0.18668313324451447,
-0.23088973760604858,
-0.9430331587791443,
-0.4356135129928589,
-2.5897679328918457,
0.2406187206506729,
0.2654496133327484,
-0.9321646690368652,
-0.2398405373096466,
-1.1015874147415161,
-0.03111991472542286,
-0.6698668003082275,
-0.194865450263... |
javascript/reference/global_objects/string/fromcodepoint/index.md | JavaScript - Global Objects - String - fromCodePoint - Syntax - Parameters:
- `num1`, …, `numN`: An integer between `0` and `0x10FFFF` (inclusive) representing a Unicode code point. | [
-0.5175602436065674,
-0.39484184980392456,
-0.9405745267868042,
-1.0420728921890259,
-0.27824312448501587,
-1.955588698387146,
-0.4185764789581299,
-0.1904466599225998,
0.005844783037900925,
-0.3038809299468994,
-0.852091908454895,
0.11552530527114868,
-0.7213800549507141,
-0.0128659987822... |
javascript/reference/global_objects/string/fromcodepoint/index.md | JavaScript - Global Objects - String - fromCodePoint - Syntax - Return value:
A string created by using the specified sequence of code points. | [
0.11769498139619827,
-0.22566738724708557,
-0.5191458463668823,
-0.2827567458152771,
-0.008990734815597534,
-1.6592698097229004,
0.33435431122779846,
0.6588667631149292,
-0.7395263910293579,
0.0010543805547058582,
-1.1194095611572266,
0.5293633937835693,
-0.27730226516723633,
0.90891832113... |
javascript/reference/global_objects/string/fromcodepoint/index.md | JavaScript - Global Objects - String - fromCodePoint - Syntax - Exceptions:
- `RangeError`: Thrown if `numN` is not an integer, is less than `0`, or is greater than `0x10FFFF` after being converted to a number. | [
-0.9168275594711304,
0.15552496910095215,
-0.5354445576667786,
-0.16341961920261383,
-0.29421576857566833,
-1.9697902202606201,
-0.41118472814559937,
0.18396468460559845,
-0.9001114964485168,
0.07164931297302246,
-1.1305714845657349,
-0.08328209817409515,
-0.9171751737594604,
-0.5853233337... |
javascript/reference/global_objects/string/fromcodepoint/index.md | JavaScript - Global Objects - String - fromCodePoint - Description:
Because `fromCodePoint()` is a static method of `String`, you always use it as `String.fromCodePoint()`, rather than as a method of a `String` value you created.
Unicode code points range from `0` to `1114111` (`0x10FFFF`). In UTF-16, each string ind... | [
-0.6540990471839905,
-0.5621325373649597,
-1.1779989004135132,
-0.7458866238594055,
0.6359950304031372,
-2.152045249938965,
0.48252999782562256,
0.16334795951843262,
-0.5905765891075134,
-0.07475674152374268,
-0.9707997441291809,
0.8616334199905396,
-0.46494555473327637,
-0.097280479967594... |
javascript/reference/global_objects/string/fromcodepoint/index.md | JavaScript - Global Objects - String - fromCodePoint - Examples - Using fromCodePoint():
Valid input:
Example:
String.fromCodePoint(42); // "*"
String.fromCodePoint(65, 90); // "AZ"
String.fromCodePoint(0x404); // "\u0404" === "Є"
String.fromCodePoint(0x2f804); // "\uD87E\uDC04"
String.fromCodePoint(194564); // "\uD... | [
-0.38352203369140625,
-0.06097405403852463,
-0.6460769176483154,
-0.7699772119522095,
0.0003289321030024439,
-1.762608528137207,
0.6019332408905029,
-0.3695567548274994,
-1.0032081604003906,
-0.01152335200458765,
-0.9222648739814758,
-0.40464022755622864,
-0.24030545353889465,
-0.492351651... |
javascript/reference/global_objects/string/fromcodepoint/index.md | JavaScript - Global Objects - String - fromCodePoint - Examples - Compared to fromCharCode():
`String.fromCharCode()` cannot return supplementary characters (i.e., code points `0x010000` – `0x10FFFF`) by specifying their code point. Instead, it requires the UTF-16 surrogate pair in order to return a supplementary char... | [
-1.112053394317627,
-0.18871891498565674,
-0.4706452786922455,
-1.1310746669769287,
0.6949498653411865,
-1.5965375900268555,
0.8144795298576355,
-0.14236226677894592,
-0.8551788330078125,
-0.5370289087295532,
-1.221270203590393,
0.014917946420609951,
-0.6768614053726196,
-0.525489807128906... |
javascript/reference/global_objects/string/tolowercase/index.md | JavaScript - Global Objects - String - toLowerCase:
The `toLowerCase()` method of `String` values returns this string converted to lower case.
Example:
const sentence = "The quick brown fox jumps over the lazy dog.";
console.log(sentence.toLowerCase());
// Expected output: "the quick brown fox jumps over the lazy d... | [
-1.4459543228149414,
0.5464290380477905,
-0.5061185359954834,
0.4084756374359131,
0.5306282043457031,
-1.7610464096069336,
0.21088308095932007,
0.7595133781433105,
-0.5215182304382324,
0.18120364844799042,
-1.1659895181655884,
0.09266876429319382,
-0.18500551581382751,
0.21753822267055511,... |
javascript/reference/global_objects/string/tolowercase/index.md | JavaScript - Global Objects - String - toLowerCase - Syntax:
Example:
toLowerCase() | [
-1.227988839149475,
0.37905123829841614,
-0.28591346740722656,
0.35683393478393555,
-0.10110128670930862,
-1.991457223892212,
0.38240963220596313,
1.253683090209961,
-0.568692147731781,
0.0830840915441513,
-1.06032395362854,
0.23777277767658234,
-0.24950091540813446,
0.6043249368667603,
... |
javascript/reference/global_objects/string/tolowercase/index.md | JavaScript - Global Objects - String - toLowerCase - Syntax - Parameters:
None. | [
-0.7909575700759888,
0.39184749126434326,
-0.6507679224014282,
-0.156754732131958,
-0.016837220638990402,
-1.5845099687576294,
0.7025243043899536,
1.138298511505127,
-0.769673228263855,
-0.12505877017974854,
-1.360263466835022,
-0.3326311409473419,
-0.115967757999897,
0.5032761693000793,
... |
javascript/reference/global_objects/string/tolowercase/index.md | JavaScript - Global Objects - String - toLowerCase - Syntax - Return value:
A new string representing the calling string converted to lower case. | [
-0.9002378582954407,
0.4596414268016815,
-0.605316698551178,
-0.03612060472369194,
0.38993072509765625,
-1.6843816041946411,
0.574674665927887,
1.2983835935592651,
-0.06039473041892052,
0.8614029288291931,
-0.9776147603988647,
0.38297268748283386,
0.1649484932422638,
1.2554678916931152,
... |
javascript/reference/global_objects/string/tolowercase/index.md | JavaScript - Global Objects - String - toLowerCase - Description:
The `toLowerCase()` method returns the value of the string converted to lower case. `toLowerCase()` does not affect the value of the string `str` itself. | [
-1.5820682048797607,
0.5411373972892761,
-0.2634125053882599,
0.2839050590991974,
0.5596498250961304,
-1.5983774662017822,
1.158617377281189,
1.0287827253341675,
-0.32534509897232056,
0.3047776520252228,
-0.7874441742897034,
0.3942835032939911,
0.2428164780139923,
0.32695454359054565,
0.... |
javascript/reference/global_objects/string/tolowercase/index.md | JavaScript - Global Objects - String - toLowerCase - Examples - Using `toLowerCase()`:
Example:
console.log("ALPHABET".toLowerCase()); // 'alphabet' | [
-0.875487744808197,
0.4438890814781189,
-0.3617810010910034,
0.8741220831871033,
0.3614063858985901,
-1.6652963161468506,
0.3789255619049072,
0.28171029686927795,
-0.3846544921398163,
-0.06763535737991333,
-0.4758042097091675,
0.2387283444404602,
0.020275501534342766,
0.3544793128967285,
... |
javascript/reference/global_objects/string/small/index.md | JavaScript - Global Objects - String - small:
Deprecated: This feature is no longer recommended.
The `small()` method of `String` values creates a string that embeds this string in a `small` element (`<small>str</small>`), which causes this string to be displayed in a small font.
Note: All HTML wrapper methods are d... | [
-1.7559760808944702,
-0.19318051636219025,
-0.39409759640693665,
-0.20893804728984833,
-0.18808278441429138,
-1.6996592283248901,
1.029769778251648,
0.4347614049911499,
-0.3113310635089874,
-0.007867100648581982,
-0.43669161200523376,
0.7917710542678833,
0.6870155334472656,
-0.470033735036... |
javascript/reference/global_objects/string/small/index.md | JavaScript - Global Objects - String - small - Syntax:
Example:
small() | [
-1.2790881395339966,
0.42802947759628296,
-1.1408960819244385,
-0.2536306381225586,
-0.4572450518608093,
-1.8859508037567139,
0.6214649081230164,
0.9507634043693542,
-0.4478844404220581,
-0.3905763030052185,
-0.3770914673805237,
0.5645244717597961,
-0.08467002213001251,
-0.0025453991256654... |
javascript/reference/global_objects/string/small/index.md | JavaScript - Global Objects - String - small - Syntax - Parameters:
None. | [
-0.8234895467758179,
0.4695104956626892,
-1.0908374786376953,
-0.7266737818717957,
-0.45226702094078064,
-1.6397701501846313,
0.7510808110237122,
0.9133687615394592,
-0.4527064859867096,
-0.4607769846916199,
-1.0065757036209106,
-0.45570647716522217,
-0.0033667385578155518,
0.0503931678831... |
javascript/reference/global_objects/string/small/index.md | JavaScript - Global Objects - String - small - Syntax - Return value:
A string beginning with a `<small>` start tag, then the text `str`, and then a `</small>` end tag. | [
-1.6276756525039673,
0.5375140309333801,
-0.4202542006969452,
-0.47031331062316895,
-0.28458836674690247,
-0.815022349357605,
0.4616977274417877,
0.6030317544937134,
-0.48064014315605164,
0.04262044280767441,
-0.5593448877334595,
0.5540939569473267,
-0.2385728657245636,
0.40247517824172974... |
javascript/reference/global_objects/string/small/index.md | JavaScript - Global Objects - String - small - Examples - Using small():
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.small();
This will create the following HTML:
Example:
<small>Hello,... | [
-1.079517126083374,
0.28053680062294006,
0.006129609886556864,
0.6583022475242615,
0.014313234016299248,
-1.9742122888565063,
-0.7545444965362549,
-0.4875221848487854,
-0.6811633706092834,
-0.12193607538938522,
-0.20751990377902985,
0.7866805791854858,
0.110226571559906,
-0.805570721626281... |
javascript/reference/global_objects/string/fromcharcode/index.md | JavaScript - Global Objects - String - fromCharCode:
The `String.fromCharCode()` static method returns a string created from the specified sequence of UTF-16 code units.
Example:
console.log(String.fromCharCode(189, 43, 190, 61));
// Expected output: "½+¾=" | [
-0.8356378078460693,
-0.5198913812637329,
-0.6732580065727234,
-0.7073085904121399,
0.2635039985179901,
-1.786185383796692,
0.25893834233283997,
0.6024584770202637,
-0.5287181735038757,
-0.17455258965492249,
-0.905619204044342,
0.11533316969871521,
-0.3290749192237854,
-0.37587472796440125... |
javascript/reference/global_objects/string/fromcharcode/index.md | JavaScript - Global Objects - String - fromCharCode - Syntax:
Example:
String.fromCharCode()
String.fromCharCode(num1)
String.fromCharCode(num1, num2)
String.fromCharCode(num1, num2, /* …, */ numN) | [
-0.6275767683982849,
-0.09384210407733917,
0.31059905886650085,
-1.137657642364502,
-0.30732184648513794,
-2.3158743381500244,
0.3143230676651001,
0.4963706135749817,
-0.8004423379898071,
0.10815008729696274,
-0.825866162776947,
-0.4391571283340454,
-1.0978444814682007,
-0.642942488193512,... |
javascript/reference/global_objects/string/fromcharcode/index.md | JavaScript - Global Objects - String - fromCharCode - Syntax - Parameters:
- `num1`, …, `numN`: A number between `0` and `65535` (`0xFFFF`) representing a UTF-16 code unit. Numbers greater than `0xFFFF` are truncated to the last 16 bits. No validity checks are performed. | [
-0.522315263748169,
-0.20260870456695557,
-0.8611621856689453,
-1.247757911682129,
-0.037851445376873016,
-1.6131843328475952,
0.011633056215941906,
0.24434322118759155,
-0.15996985137462616,
0.027116646990180016,
-1.4600945711135864,
0.2259911447763443,
-0.7178386449813843,
-0.30013588070... |
javascript/reference/global_objects/string/fromcharcode/index.md | JavaScript - Global Objects - String - fromCharCode - Syntax - Return value:
A string of length `N` consisting of the `N` specified UTF-16 code units. | [
-0.7405254244804382,
-0.09571881592273712,
-0.8164507746696472,
-0.46647801995277405,
-0.042614083737134933,
-1.633237361907959,
0.6054564714431763,
0.6518229246139526,
-0.4441831409931183,
0.052910659462213516,
-1.0151176452636719,
0.9629067778587341,
-0.48241451382637024,
0.3544893562793... |
javascript/reference/global_objects/string/fromcharcode/index.md | JavaScript - Global Objects - String - fromCharCode - Description:
Because `fromCharCode()` is a static method of `String`, you always use it as `String.fromCharCode()`, rather than as a method of a `String` value you created.
Unicode code points range from `0` to `1114111` (`0x10FFFF`). `charCodeAt()` always returns... | [
-0.5931276082992554,
-0.2609626352787018,
-0.9397730231285095,
-0.9856122732162476,
0.715652346611023,
-1.4776113033294678,
0.6499603986740112,
-0.029283342882990837,
-0.8080158829689026,
0.1695639193058014,
-1.1802423000335693,
0.5499279499053955,
-1.027524709701538,
-0.29535216093063354,... |
javascript/reference/global_objects/string/fromcharcode/index.md | JavaScript - Global Objects - String - fromCharCode - Examples - Using fromCharCode():
BMP characters, in UTF-16, use a single code unit:
Example:
String.fromCharCode(65, 66, 67); // returns "ABC"
String.fromCharCode(0x2014); // returns "—"
String.fromCharCode(0x12014); // also returns "—"; the digit 1 is truncated ... | [
-1.5340362787246704,
-0.004180891904979944,
-1.0196523666381836,
-1.3020590543746948,
0.6260678768157959,
-1.7559840679168701,
0.8647984266281128,
-0.4466613531112671,
-0.9966267943382263,
-0.1431926041841507,
-1.590696930885315,
-0.2036171555519104,
-0.1834433525800705,
-0.725613355636596... |
javascript/reference/global_objects/string/italics/index.md | JavaScript - Global Objects - String - italics:
Deprecated: This feature is no longer recommended.
The `italics()` method of `String` values creates a string that embeds this string in an `i` element (`<i>str</i>`), which causes this string to be displayed as italic.
Note: All HTML wrapper methods are deprecated and... | [
-0.9672354459762573,
-0.48025137186050415,
-0.07646314054727554,
0.2780942916870117,
-0.16828623414039612,
-1.854099988937378,
1.0234752893447876,
0.49193063378334045,
-0.16782806813716888,
0.2250571995973587,
-0.6339591145515442,
0.6058396100997925,
0.19811607897281647,
-0.086533479392528... |
javascript/reference/global_objects/string/italics/index.md | JavaScript - Global Objects - String - italics - Syntax:
Example:
italics() | [
-0.5313965678215027,
0.17723265290260315,
-0.5862330198287964,
0.18312305212020874,
-0.547195315361023,
-1.988459825515747,
0.8835643529891968,
1.137608289718628,
-0.09762153029441833,
-0.2956518530845642,
-0.030798910185694695,
0.42717793583869934,
-0.10377028584480286,
-0.134432315826416... |
javascript/reference/global_objects/string/italics/index.md | JavaScript - Global Objects - String - italics - Syntax - Parameters:
None. | [
-0.49698778986930847,
0.21389584243297577,
-0.6995102167129517,
-0.32837995886802673,
-0.32531508803367615,
-1.4449506998062134,
1.029690146446228,
1.0193663835525513,
-0.08596483618021011,
-0.22227241098880768,
-0.6897018551826477,
-0.4851968288421631,
0.059201985597610474,
0.096514761447... |
javascript/reference/global_objects/string/italics/index.md | JavaScript - Global Objects - String - italics - Syntax - Return value:
A string beginning with an `<i>` start tag, then the text `str`, and then an `</i>` end tag. | [
-1.2498310804367065,
0.19562296569347382,
-0.18673379719257355,
-0.3336329758167267,
-0.12184388190507889,
-0.9029394388198853,
0.33165428042411804,
0.7605722546577454,
-0.3507424592971802,
0.1539415419101715,
-0.6994485259056091,
0.10404311865568161,
-0.5203868746757507,
0.740949451923370... |
javascript/reference/global_objects/string/italics/index.md | JavaScript - Global Objects - String - italics - Examples - Using italics():
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.italics();
This will create the following HTML:
Example:
<i>Hell... | [
-0.46132001280784607,
0.046861324459314346,
0.06368720531463623,
1.0155503749847412,
-0.0609816312789917,
-2.1061785221099854,
-0.4332925081253052,
-0.27354463934898376,
-0.45616981387138367,
-0.11621569842100143,
-0.3245731592178345,
0.8855550289154053,
-0.16228757798671722,
-0.4087356030... |
javascript/reference/global_objects/string/padend/index.md | JavaScript - Global Objects - String - padEnd:
The `padEnd()` 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 end of this string.
Example:
const str1 = "Breaded Mushrooms";
console.... | [
-0.7285206913948059,
-0.648329496383667,
-1.0894279479980469,
-0.2477426528930664,
-0.5126422643661499,
-1.8647764921188354,
0.9467379450798035,
0.2926059663295746,
-0.6105731129646301,
0.27929943799972534,
-1.253775954246521,
0.19318553805351257,
-0.3901597857475281,
0.4056312143802643,
... |
javascript/reference/global_objects/string/padend/index.md | JavaScript - Global Objects - String - padEnd - Syntax:
Example:
padEnd(targetLength)
padEnd(targetLength, padString) | [
-0.49936121702194214,
0.006518424954265356,
-1.1399410963058472,
-1.1145367622375488,
-1.0984904766082764,
-1.842294692993164,
0.7146377563476562,
0.8597195744514465,
-0.5041742324829102,
-0.20963755249977112,
-0.6272324323654175,
0.17781955003738403,
-0.4088727533817291,
-0.27243706583976... |
javascript/reference/global_objects/string/padend/index.md | JavaScript - Global Objects - String - padEnd - 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 `pad... | [
-1.977975606918335,
-0.16961956024169922,
-1.161376953125,
-0.9106024503707886,
-0.2018621861934662,
-1.9560623168945312,
0.8396574258804321,
-0.49864712357521057,
-0.4364284574985504,
0.2347610592842102,
-1.1163734197616577,
0.3652712404727936,
-0.1727963387966156,
0.25367406010627747,
... |
javascript/reference/global_objects/string/padend/index.md | JavaScript - Global Objects - String - padEnd - Syntax - Return value:
A `String` of the specified `targetLength` with `padString` applied at the end. | [
-0.7545531988143921,
-0.28724217414855957,
-1.3103675842285156,
-1.0917240381240845,
-0.6774914860725403,
-1.5334672927856445,
0.8480408787727356,
0.6074483394622803,
-0.6592050194740295,
0.22999173402786255,
-0.7515767216682434,
0.43747907876968384,
-0.09771443903446198,
0.378400266170501... |
javascript/reference/global_objects/string/padend/index.md | JavaScript - Global Objects - String - padEnd - Examples - Using String.prototype.padEnd():
Example:
"abc".padEnd(10); // "abc "
"abc".padEnd(10, "foo"); // "abcfoofoof"
"abc".padEnd(6, "123456"); // "abc123"
"abc".padEnd(1); // "abc" | [
-0.30637413263320923,
0.20189616084098816,
-0.6193337440490723,
-1.0608172416687012,
-0.35513192415237427,
-1.677237868309021,
1.2204957008361816,
0.47953134775161743,
-0.2325247973203659,
0.0006338583189062774,
-0.6017144918441772,
-0.036429956555366516,
-0.4288698732852936,
-0.2332794219... |
javascript/reference/global_objects/string/length/index.md | JavaScript - Global Objects - String - length:
The `length` data property of a `String` value contains the length of the string in UTF-16 code units.
Example:
const str = "Life, the universe and everything. Answer:";
console.log(`${str} ${str.length}`);
// Expected output: "Life, the universe and everything. Answer... | [
-1.6977490186691284,
-0.6883297562599182,
-1.0724226236343384,
0.03757079318165779,
-0.2204141467809677,
-1.802438497543335,
-0.6155424118041992,
-0.2508881390094757,
0.3642510175704956,
-0.6936106085777283,
-1.0146230459213257,
0.27716580033302307,
-0.2545793950557709,
-0.2721810340881347... |
javascript/reference/global_objects/string/length/index.md | JavaScript - Global Objects - String - length - Value:
A non-negative integer. | [
-1.4118484258651733,
-0.8677648901939392,
-0.8909757137298584,
-0.4921163320541382,
-0.6304094791412354,
-1.5045537948608398,
0.7283040285110474,
-0.018146460875868797,
-0.5037157535552979,
-0.45293450355529785,
-0.9757579565048218,
-0.34955641627311707,
-0.28830793499946594,
-0.2187862992... |
javascript/reference/global_objects/string/length/index.md | JavaScript - Global Objects - String - length - Description:
This property returns the number of code units in the string. JavaScript uses UTF-16 encoding, where each Unicode character may be encoded as one or two code units, so it's possible for the value returned by `length` to not match the actual number of Unicode... | [
-0.6542350649833679,
-0.17672765254974365,
-0.6540961265563965,
-0.06258340924978256,
0.9390116333961487,
-0.9815722107887268,
0.1773332804441452,
-0.01850751042366028,
-0.16796369850635529,
-0.19972684979438782,
-0.08541301637887955,
0.9780018925666809,
-0.7752153873443604,
0.183060362935... |
javascript/reference/global_objects/string/length/index.md | JavaScript - Global Objects - String - length - Examples - Basic usage:
Example:
const x = "Mozilla";
const empty = "";
console.log(`${x} is ${x.length} code units long`);
// Mozilla is 7 code units long
console.log(`The empty string has a length of ${empty.length}`);
// The empty string has a length of 0 | [
-0.42726749181747437,
-0.2020871341228485,
-0.9751759767532349,
0.09731721878051758,
-0.2835261821746826,
-2.218385934829712,
0.4412502348423004,
-0.31925684213638306,
0.06516468524932861,
-0.3523032069206238,
-0.3871525228023529,
-0.28300368785858154,
-0.23655836284160614,
-0.423556149005... |
javascript/reference/global_objects/string/length/index.md | JavaScript - Global Objects - String - length - Examples - Strings with length not equal to the number of characters:
Example:
const emoji = "😄";
console.log(emoji.length); // 2
console.log([...emoji].length); // 1
const adlam = "𞤲𞥋𞤣𞤫";
console.log(adlam.length); // 8
console.log([...adlam].length); // 4
const f... | [
-0.5613030195236206,
-0.4918806254863739,
-0.4633036255836487,
-0.8534328937530518,
-0.5550543069839478,
-1.9928581714630127,
-0.6524425745010376,
-0.2570998966693878,
0.08573058992624283,
-0.47856518626213074,
0.03496142849326134,
0.02969158999621868,
-0.31263595819473267,
-0.338441669940... |
javascript/reference/global_objects/string/length/index.md | JavaScript - Global Objects - String - length - Examples - Assigning to length:
Because string is a primitive, attempting to assign a value to a string's `length` property has no observable effect, and will throw in strict mode.
Example:
const myString = "bluebells";
myString.length = 4;
console.log(myString); // "... | [
-1.2809087038040161,
0.23171013593673706,
-1.0589181184768677,
-0.40851518511772156,
-0.6243919134140015,
-1.645099401473999,
0.594580352306366,
-0.03819938004016876,
0.018965722993016243,
-0.12474760413169861,
-0.9744774103164673,
-0.012144861742854118,
-0.3020012378692627,
0.125371843576... |
javascript/reference/global_objects/string/endswith/index.md | JavaScript - Global Objects - String - endsWith:
The `endsWith()` method of `String` values determines whether a string ends with the characters of this string, returning `true` or `false` as appropriate.
Example:
const str1 = "Cats are the best!";
console.log(str1.endsWith("best!"));
// Expected output: true
cons... | [
-1.8040965795516968,
-0.6804134845733643,
-0.2680070102214813,
0.05943164974451065,
-0.5643888115882874,
-2.3270344734191895,
-0.2622275650501251,
-0.6094541549682617,
0.3046816289424896,
0.3336527645587921,
-0.8400611281394958,
0.3630964457988739,
0.1612725704908371,
0.4121280610561371,
... |
javascript/reference/global_objects/string/endswith/index.md | JavaScript - Global Objects - String - endsWith - Syntax:
Example:
endsWith(searchString)
endsWith(searchString, endPosition) | [
-0.8144549131393433,
-0.05440756306052208,
0.4083930253982544,
-0.5021646618843079,
-1.3601021766662598,
-2.1449227333068848,
-0.5196746587753296,
0.11474906653165817,
0.21559415757656097,
-0.5166579484939575,
-0.18440218269824982,
0.18018241226673126,
0.21397481858730316,
0.29439884424209... |
javascript/reference/global_objects/string/endswith/index.md | JavaScript - Global Objects - String - endsWith - Syntax - Parameters:
- `searchString`: The characters to be searched for at the end of `str`. Cannot be a regex. All values that are not regexes are coerced to strings, so omitting it or passing `undefined` causes `endsWith()` to search for the string `"undefined"`, wh... | [
-1.3889328241348267,
-0.11644822359085083,
-0.15535572171211243,
-0.6360796093940735,
-0.46823349595069885,
-1.6275800466537476,
0.39925310015678406,
-0.881506085395813,
0.33503779768943787,
-0.37361228466033936,
-0.5902584791183472,
-0.07190673798322678,
0.2687430679798126,
0.356870710849... |
javascript/reference/global_objects/string/endswith/index.md | JavaScript - Global Objects - String - endsWith - Syntax - Return value:
`true` if the given characters are found at the end of the string, including when `searchString` is an empty string; otherwise, `false`. | [
-1.3754582405090332,
-0.4357032775878906,
0.26217180490493774,
-0.4120346009731293,
-0.7427861094474792,
-2.1562018394470215,
1.0819697380065918,
-0.2911423444747925,
-0.49860745668411255,
-0.016730332747101784,
-0.4616400897502899,
-0.09005492180585861,
0.6302659511566162,
0.3747221231460... |
javascript/reference/global_objects/string/endswith/index.md | JavaScript - Global Objects - String - endsWith - Syntax - Exceptions:
- `TypeError`: Thrown if `searchString` is a regex. | [
-1.2322733402252197,
0.1849890947341919,
-0.06938227266073227,
-0.25203439593315125,
-0.7064659595489502,
-1.3463358879089355,
-0.2657651901245117,
0.44534599781036377,
-0.45052146911621094,
-0.585830807685852,
-0.6512680053710938,
-0.3998827636241913,
0.3417697548866272,
-0.31853771209716... |
javascript/reference/global_objects/string/endswith/index.md | JavaScript - Global Objects - String - endsWith - Description:
This method lets you determine whether or not a string ends with another string. This method is case-sensitive. | [
-1.2329565286636353,
-0.1697705090045929,
0.24696873128414154,
-0.2189914733171463,
-0.8838678002357483,
-2.183753490447998,
0.1443301886320114,
0.03995196521282196,
0.4535479247570038,
0.23019030690193176,
-0.9242594242095947,
0.18574440479278564,
0.46440643072128296,
0.5624569058418274,
... |
javascript/reference/global_objects/string/endswith/index.md | JavaScript - Global Objects - String - endsWith - Examples - Using endsWith():
Example:
const str = "To be, or not to be, that is the question.";
console.log(str.endsWith("question.")); // true
console.log(str.endsWith("to be")); // false
console.log(str.endsWith("to be", 19)); // true | [
-0.7042458653450012,
0.10654081404209137,
0.6042038202285767,
0.01321262214332819,
-1.1738046407699585,
-1.8935134410858154,
-0.2629534602165222,
-0.41183438897132874,
0.43992072343826294,
-0.3680162727832794,
-0.1009179875254631,
0.39865291118621826,
0.09355051070451736,
-0.00734708737581... |
javascript/reference/global_objects/string/includes/index.md | JavaScript - Global Objects - String - includes:
The `includes()` method of `String` values performs a case-sensitive search to determine whether a given string may be found within this string, returning `true` or `false` as appropriate.
Example:
const sentence = "The quick brown fox jumps over the lazy dog.";
cons... | [
-1.772691011428833,
-0.8955233693122864,
-0.7729674577713013,
0.8839482665061951,
0.0739877000451088,
-1.5708916187286377,
0.9151239991188049,
-0.3684106469154358,
0.2661312520503998,
0.030855350196361542,
-0.9971687197685242,
-0.47577324509620667,
0.22120976448059082,
-0.08132608979940414... |
javascript/reference/global_objects/string/includes/index.md | JavaScript - Global Objects - String - includes - Syntax:
Example:
includes(searchString)
includes(searchString, position) | [
-1.4216562509536743,
-0.14725294709205627,
-1.0639156103134155,
0.1400326043367386,
-0.39380770921707153,
-1.364991545677185,
0.10331817716360092,
-0.11254695802927017,
0.25775957107543945,
-0.43018805980682373,
-0.126562237739563,
-0.12577399611473083,
0.12559954822063446,
-0.237274304032... |
javascript/reference/global_objects/string/includes/index.md | JavaScript - Global Objects - String - includes - Syntax - Parameters:
- `searchString`: A string to be searched for within `str`. Cannot be a regex. All values that are not regexes are coerced to strings, so omitting it or passing `undefined` causes `includes()` to search for the string `"undefined"`, which is rarely... | [
-1.297711968421936,
0.00860479287803173,
-0.927179217338562,
0.196824312210083,
0.13446210324764252,
-1.3046319484710693,
0.6410168409347534,
-0.6424480676651001,
0.24991242587566376,
0.10119454562664032,
-0.7068328261375427,
-0.4174725413322449,
0.03054877743124962,
-0.04323562607169151,
... |
javascript/reference/global_objects/string/includes/index.md | JavaScript - Global Objects - String - includes - Syntax - Return value:
`true` if the search string is found anywhere within the given string, including when `searchString` is an empty string; otherwise, `false`. | [
-1.6025426387786865,
-0.34718745946884155,
-0.6507214903831482,
0.32212555408477783,
-0.24581271409988403,
-1.7758209705352783,
0.9841229915618896,
-0.20153172314167023,
-0.5380684733390808,
-0.20121531188488007,
-0.8745577931404114,
-0.21705086529254913,
0.47007057070732117,
0.04289023950... |
javascript/reference/global_objects/string/includes/index.md | JavaScript - Global Objects - String - includes - Syntax - Exceptions:
- `TypeError`: Thrown if `searchString` is a regex. | [
-1.5471910238265991,
0.2719181478023529,
-0.7556506395339966,
-0.03537306934595108,
-0.2302027940750122,
-1.0337231159210205,
0.08597250282764435,
0.42603373527526855,
-0.41366857290267944,
-0.6311492323875427,
-0.9203620553016663,
-0.5489640235900879,
0.10913306474685669,
-0.4093859195709... |
javascript/reference/global_objects/string/includes/index.md | JavaScript - Global Objects - String - includes - Description:
This method lets you determine whether or not a string includes another string. | [
-1.4859611988067627,
-0.32845041155815125,
-0.7028185725212097,
0.13620227575302124,
-0.15543782711029053,
-1.9131819009780884,
0.790476381778717,
0.317435622215271,
0.32799646258354187,
0.1051744893193245,
-1.219280481338501,
-0.3069990873336792,
0.006461950019001961,
-0.18339486420154572... |
javascript/reference/global_objects/string/includes/index.md | JavaScript - Global Objects - String - includes - Description - Case-sensitivity:
The `includes()` method is case sensitive. For example, the following expression returns `false`:
Example:
"Blue Whale".includes("blue"); // returns false
You can work around this constraint by transforming both the original string an... | [
-1.2531687021255493,
0.07781673967838287,
-0.2876507639884949,
0.818189799785614,
0.021722810342907906,
-1.5552449226379395,
0.6509466767311096,
0.31463244557380676,
-0.5844103097915649,
0.7280688285827637,
-0.455355703830719,
0.5209327340126038,
0.927444338798523,
-0.20095409452915192,
... |
javascript/reference/global_objects/string/includes/index.md | JavaScript - Global Objects - String - includes - Examples - Using includes():
Example:
const str = "To be, or not to be, that is the question.";
console.log(str.includes("To be")); // true
console.log(str.includes("question")); // true
console.log(str.includes("nonexistent")); // false
console.log(str.includes("To ... | [
-0.8746647238731384,
0.16684770584106445,
-0.6706296801567078,
0.7353726625442505,
-0.26544755697250366,
-1.6860617399215698,
0.09985991567373276,
-0.564468264579773,
0.6459332704544067,
0.4844343364238739,
-0.12447111308574677,
0.028993181884288788,
0.12057621777057648,
-0.480408817529678... |
javascript/reference/global_objects/string/slice/index.md | JavaScript - Global Objects - String - slice:
The `slice()` method of `String` values extracts a section of this string and returns it as a new string, without modifying the original string.
Example:
const str = "The quick brown fox jumps over the lazy dog.";
console.log(str.slice(31));
// Expected output: "the laz... | [
-1.7878352403640747,
-0.29132920503616333,
-0.8635479211807251,
0.49366477131843567,
0.4338533282279968,
-1.1028869152069092,
0.43178462982177734,
-0.34364911913871765,
-0.6466275453567505,
0.13387027382850647,
-0.8027979135513306,
-0.11114551872015,
-0.20238322019577026,
0.262198269367218... |
javascript/reference/global_objects/string/slice/index.md | JavaScript - Global Objects - String - slice - Syntax:
Example:
slice(indexStart)
slice(indexStart, indexEnd) | [
-0.91902095079422,
0.33805468678474426,
-0.5259775519371033,
0.3751361072063446,
-0.2417108416557312,
-1.0142455101013184,
0.3508068323135376,
0.6133674383163452,
-0.10119399428367615,
-0.41123247146606445,
-0.1596512496471405,
0.1812455952167511,
-0.46035128831863403,
0.3189595639705658,
... |
javascript/reference/global_objects/string/slice/index.md | JavaScript - Global Objects - String - slice - Syntax - Parameters:
- `indexStart`: The index of the first character to include in the returned substring.
- `indexEnd` (optional): The index of the first character to exclude from the returned substring. | [
-1.1136977672576904,
-0.2959757149219513,
-0.32153192162513733,
0.17308229207992554,
0.0781303346157074,
-1.246019959449768,
1.215530514717102,
-0.5415963530540466,
0.30356594920158386,
0.13218918442726135,
-0.9447164535522461,
0.013578362762928009,
-0.35657286643981934,
0.2206884324550628... |
javascript/reference/global_objects/string/slice/index.md | JavaScript - Global Objects - String - slice - Syntax - Return value:
A new string containing the extracted section of the string. | [
-1.0123053789138794,
-0.2970789074897766,
-0.7130061984062195,
0.2839798629283905,
-0.02118494361639023,
-0.8225119113922119,
0.469332754611969,
0.6290240287780762,
0.0333506315946579,
0.37970536947250366,
-0.3200647830963135,
0.5462583899497986,
-0.7464192509651184,
1.4199419021606445,
... |
javascript/reference/global_objects/string/slice/index.md | JavaScript - Global Objects - String - slice - Description:
`slice()` extracts the text from one string and returns a new string.
`slice()` extracts up to but not including `indexEnd`. For example, `str.slice(4, 8)` extracts the fifth character through the eighth character (characters indexed `4`, `5`, `6`, and `7`):... | [
-1.4547513723373413,
-0.16605739295482635,
-0.3082507848739624,
0.371182382106781,
0.6122714281082153,
-1.0201385021209717,
0.5470020174980164,
-0.1900157332420349,
-0.13663172721862793,
0.4160546064376831,
-0.7455997467041016,
-0.10109909623861313,
-0.6521888375282288,
0.48797059059143066... |
javascript/reference/global_objects/string/slice/index.md | JavaScript - Global Objects - String - slice - Examples - Using slice() to create a new string:
The following example uses `slice()` to create a new string.
Example:
const str1 = "The morning is upon us."; // The length of str1 is 23.
const str2 = str1.slice(1, 8);
const str3 = str1.slice(4, -2);
const str4 = str1.s... | [
-0.7071416974067688,
0.39300423860549927,
-0.8389433026313782,
0.5981086492538452,
0.24477854371070862,
-1.261680006980896,
0.06034570187330246,
-0.26863619685173035,
-0.10558630526065826,
0.07771799713373184,
-0.7684789299964905,
0.11904054135084152,
-0.028300318866968155,
-0.156484976410... |
javascript/reference/global_objects/string/slice/index.md | JavaScript - Global Objects - String - slice - Examples - Using slice() with negative indexes:
The following example uses `slice()` with negative indexes.
Example:
const str = "The morning is upon us.";
str.slice(-3); // 'us.'
str.slice(-3, -1); // 'us'
str.slice(0, -1); // 'The morning is upon us'
str.slice(4, -1);... | [
-1.1137876510620117,
0.41116371750831604,
-0.5784552693367004,
0.6477106213569641,
0.1990291178226471,
-0.7896005511283875,
0.9701095819473267,
-0.12415878474712372,
-0.4456653296947479,
0.4690781533718109,
-0.46731218695640564,
0.325859397649765,
-0.2539249360561371,
0.151738703250885,
... |
javascript/reference/global_objects/string/match/index.md | JavaScript - Global Objects - String - match:
The `match()` method of `String` values retrieves the result of matching this string against a regular expression.
Example:
const paragraph = "The quick brown fox jumps over the lazy dog. It barked.";
const regex = /[A-Z]/g;
const found = paragraph.match(regex);
console... | [
-0.2870766818523407,
-0.4287939965724945,
-1.1732840538024902,
0.2523641288280487,
0.01764266937971115,
-1.5625382661819458,
0.6168994903564453,
0.09035954624414444,
-0.35735803842544556,
0.10105778276920319,
-1.4762871265411377,
-0.29395148158073425,
0.10697901993989944,
0.101488463580608... |
javascript/reference/global_objects/string/match/index.md | JavaScript - Global Objects - String - match - Syntax:
Example:
match(regexp) | [
-0.3993164598941803,
0.22527191042900085,
-0.7091825604438782,
-0.9889774322509766,
-0.8057904839515686,
-1.3001364469528198,
0.52179354429245,
0.4601065218448639,
0.23994231224060059,
-0.30669930577278137,
-0.7173434495925903,
-0.2757240831851959,
0.019948184490203857,
0.4722498059272766,... |
javascript/reference/global_objects/string/match/index.md | JavaScript - Global Objects - String - match - Syntax - Parameters:
- `regexp`: A regular expression object, or any object that has a `Symbol.match` method. If `regexp` is not a `RegExp` object and does not have a `Symbol.match` method, it is implicitly converted to a `RegExp` by using `new RegExp(regexp)`. If you don... | [
-0.4804244339466095,
0.09498005360364914,
-0.5780847072601318,
-0.4359774589538574,
-0.34847697615623474,
-1.3546663522720337,
0.5636046528816223,
1.0397003889083862,
0.7181363701820374,
-0.3752115070819855,
-0.5480793714523315,
-0.31847453117370605,
0.4184512794017792,
0.4407230317592621,... |
javascript/reference/global_objects/string/match/index.md | JavaScript - Global Objects - String - match - Syntax - Return value:
An `Array` whose contents depend on the presence or absence of the global (`g`) flag, or `null` if no matches are found.
- If the `g` flag is used, all results matching the complete regular expression will be returned, but capturing groups are not ... | [
-0.5631303787231445,
-0.3540194630622864,
-0.8483015298843384,
0.2616187632083893,
-0.31637880206108093,
-1.7735298871994019,
0.8955603241920471,
0.7579039931297302,
-0.5781171917915344,
0.2900373339653015,
-1.0916755199432373,
0.03040950372815132,
0.0773976743221283,
0.6150220036506653,
... |
javascript/reference/global_objects/string/match/index.md | JavaScript - Global Objects - String - match - Description:
The implementation of `String.prototype.match` doesn't do much other than calling the `Symbol.match` method of the argument with the string as the first parameter. The actual implementation comes from `RegExp.prototype[Symbol.match]()`.
- If you need to know... | [
-0.4045752286911011,
0.2512473464012146,
-0.8159361481666565,
-0.23657843470573425,
-0.4326723515987396,
-1.2324938774108887,
1.065291166305542,
0.23317991197109222,
0.22022920846939087,
0.025746457278728485,
-1.3513035774230957,
-0.6029520034790039,
0.2195684164762497,
0.18860791623592377... |
javascript/reference/global_objects/string/match/index.md | JavaScript - Global Objects - String - match - Examples - Using match():
In the following example, `match()` is used to find `"Chapter"` followed by one or more numeric characters followed by a decimal point and numeric character zero or more times.
The regular expression includes the `i` flag so that upper/lower cas... | [
-0.303232878446579,
-0.3601475954055786,
-1.0074973106384277,
0.11133944988250732,
0.4983374774456024,
-1.4161099195480347,
1.0962709188461304,
-0.5312206149101257,
-0.2638000547885895,
0.1504894495010376,
-1.3505134582519531,
-0.04362386092543602,
-0.14963145554065704,
0.8729069232940674,... |
javascript/reference/global_objects/string/match/index.md | JavaScript - Global Objects - String - match - Examples - Using global and ignoreCase flags with match():
The following example demonstrates the use of the global flag and ignore-case flag with `match()`. All letters `A` through `E` and `a` through `e` are returned, each its own element in the array.
Example:
const ... | [
0.05366356670856476,
0.4695272743701935,
-0.4874088168144226,
-0.03748997300863266,
-0.19878464937210083,
-1.656805396080017,
1.45415461063385,
-0.50833660364151,
-0.7105505466461182,
0.17923764884471893,
-0.2569945156574249,
0.13795655965805054,
0.19329264760017395,
0.34683334827423096,
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.