recursal/MDN huggingface dataset:
String.prototype.toLocaleUpperCase()
====================================

The **`toLocaleUpperCase()`** method of `String` values returns this string converted to upper case, according to any locale-specific case mappings.

Try it
------

Syntax
------


```js
toLocaleUpperCase()
toLocaleUpperCase(locales)
```

### 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 upper case according to any locale-specific case mappings. For the general form and interpretation of the `locales` argument, see the parameter description on the `Intl` main page.

Unlike other methods that use the `locales` argument, `toLocaleUpperCase()` does not allow locale matching. Therefore, after checking the validity of the `locales` argument, `toLocaleUpperCase()` always uses the first locale in the list (or the default locale if the list is empty), even if this locale is not supported by the implementation.

### Return value

 A new string representing the calling string converted to upper case, according to any
 locale-specific case mappings.

Description
-----------

 The `toLocaleUpperCase()` method returns the value of the string converted
 to upper case according to any locale-specific case mappings.
 `toLocaleUpperCase()` does not affect the value of the string itself. In most
 cases, this will produce the same result as `toUpperCase()`, but for some locales, such as Turkish, whose case mappings do not
 follow the default case mappings in Unicode, there may be a different result.

 Also notice that conversion is not necessarily a 1:1 character mapping, as some
 characters might result in two (or even more) characters when transformed to upper-case.
 Therefore the length of the result string can differ from the input length. This also
 implies that the conversion is not stable, so i.E. the following can return
 `false`:
 `x.toLocaleLowerCase() === x.toLocaleUpperCase().toLocaleLowerCase()`

Examples
--------

### Using toLocaleUpperCase()


```js
"alphabet".toLocaleUpperCase(); // 'ALPHABET'

"Gesäß".toLocaleUpperCase(); // 'GESÄSS'

"i\u0307".toLocaleUpperCase("lt-LT"); // 'I'

const locales = ["lt", "LT", "lt-LT", "lt-u-co-phonebk", "lt-x-lietuva"];
"i\u0307".toLocaleUpperCase(locales); // 'I'
```

Specifications
--------------

| Specification |
| --- |
| ECMAScript Language Specification # sec-string.prototype.tolocaleuppercase |
| ECMAScript Internationalization API Specification # sup-string.prototype.tolocaleuppercase |

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.

See also
--------

* `String.prototype.toLocaleLowerCase()`
* `String.prototype.toLowerCase()`
* `String.prototype.toUpperCase()`
FinalizationRegistry() constructor
==================================

The **`FinalizationRegistry()`** constructor creates `FinalizationRegistry` objects.

Syntax
------


```js
new FinalizationRegistry(callbackFn)
```


**Note:** `FinalizationRegistry()` can only be constructed with `new`. Attempting to call it without `new` throws a `TypeError`.

### Parameters

`callback`

A function to be invoked each time a registered target value is garbage collected. Its return value is ignored. The function is called with the following arguments:

`heldValue`

The value that was passed to the second parameter of the `register()` method when the `target` object was registered.


Examples
--------

### Creating a new registry

You create the registry passing in the callback:


```js
const registry = new FinalizationRegistry((heldValue) => {
  // …
});
```

Specifications
--------------

| Specification |
| --- |
| ECMAScript Language Specification # sec-finalization-registry-constructor |

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.

See also
--------

* `FinalizationRegistry`
FinalizationRegistry.prototype.register()
=========================================

The **`register()`** method of `FinalizationRegistry` instances registers an value with this `FinalizationRegistry` so that if the value is garbage-collected, the registry's callback may get called.

Syntax
------


```js
register(target, heldValue)
register(target, heldValue, unregisterToken)
```

### Parameters

`target`

The target value to register.

`heldValue`

The value to pass to the finalizer for this `target`. This cannot be the `target` itself but can be anything else, including functions and primitives.

`unregisterToken` Optional

A token that may be used with the `unregister` method later to unregister the target value. If provided (and not `undefined`), this must be an object or a non-registered symbol. If not provided, the target cannot be unregistered.

### Return value

None (`undefined`).

### Exceptions

`TypeError`

Thrown in one of the following cases:

* `target` is not an object or a non-registered symbol (object as opposed to primitives; functions are objects as well)
* `target` is the same as `heldvalue` (`target === heldValue`)
* `unregisterToken` is not an object or a non-registered symbol

Description
-----------

 See the Avoid where possible
 and Notes on cleanup callbacks
 sections of the `FinalizationRegistry` page for important caveats.

Examples
--------

### Using register

 The following registers the value referenced by `target`,
 passing in the held value `"some value"` and passing the target itself
 as the unregistration token:


```js
registry.register(target, "some value", target);
```


 The following registers the value referenced by `target`,
 passing in another object as the held value, and not passing in any unregistration token
 (which means `target` can't be unregistered):


```js
registry.register(target, { useful: "info about target" });
```

Specifications
--------------

| Specification |
| --- |
| ECMAScript Language Specification # sec-finalization-registry.prototype.register |

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.

See also
--------

* `FinalizationRegistry`
Date.prototype.setFullYear()
============================

The **`setFullYear()`** method of `Date` instances changes the year, month, and/or day of month for this date according to local time.

Try it
------

Syntax
------


```js
setFullYear(yearValue)
setFullYear(yearValue, monthValue)
setFullYear(yearValue, monthValue, dateValue)
```

### Parameters

`yearValue`

An integer representing the year. For example, 1995.

`monthValue` Optional

An integer representing the month: 0 for January, 1 for February, and so on.

`dateValue` Optional

An integer between 1 and 31 representing the day of the month. If you specify `dateValue`, you must also specify `monthValue`.

### Return value

Changes the `Date` object in place, and returns its new timestamp. If a parameter is `NaN` (or other values that get coerced to `NaN`, such as `undefined`), the date is set to Invalid Date and `NaN` is returned.

Description
-----------

If you do not specify the `monthValue` and `dateValue` parameters, the same values as what are returned by `getMonth()` and `getDate()` are used.

If a parameter you specify is outside of the expected range, other parameters and the date information in the `Date` object are updated accordingly. For example, if you specify 15 for `monthValue`, the year is incremented by 1 (`yearValue + 1`), and 3 is used for the month.

Examples
--------

### Using setFullYear()


```js
const theBigDay = new Date();
theBigDay.setFullYear(1997);
```

Specifications
--------------

| Specification |
| --- |
| ECMAScript Language Specification # sec-date.prototype.setfullyear |

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.

See also
--------

* `Date.prototype.getUTCFullYear()`
* `Date.prototype.setUTCFullYear()`
* `Date.prototype.setYear()`
Date.prototype.getUTCMonth()
============================

The **`getUTCMonth()`** method of `Date` instances returns the month for this date according to universal time, as a zero-based value (where zero indicates the first month of the year).

Try it
------

Syntax
------


```js
getUTCMonth()
```

### Parameters

None.

### Return value

An integer, between 0 and 11, representing the month for the given date according to universal time: 0 for January, 1 for February, and so on. Returns `NaN` if the date is invalid.

Examples
--------

### Using getUTCMonth()

The following example assigns the month portion of the current date to the variable `month`.


```js
const today = new Date();
const month = today.getUTCMonth();
```

Specifications
--------------

| Specification |
| --- |
| ECMAScript Language Specification # sec-date.prototype.getutcmonth |

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.

See also
--------

* `Date.prototype.getMonth()`
* `Date.prototype.setUTCMonth()`
Date.prototype.getMilliseconds()
================================

The **`getMilliseconds()`** method of `Date` instances returns the milliseconds for this date according to local time.

Try it
------

Syntax
------


```js
getMilliseconds()
```

### Parameters

None.

### Return value

An integer, between 0 and 999, representing the milliseconds for the given date according to local time. Returns `NaN` if the date is invalid.

Examples
--------

### Using getMilliseconds()

The `milliseconds` variable has value `0`, based on the value of the `Date` object `xmas95`, which doesn't specify the milliseconds component, so it defaults to 0.


```js
const xmas95 = new Date("1995-12-25T23:15:30");
const milliseconds = xmas95.getMilliseconds();

console.log(milliseconds); // 0
```

Specifications
--------------

| Specification |
| --- |
| ECMAScript Language Specification # sec-date.prototype.getmilliseconds |

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.

See also
--------

* `Date.prototype.getUTCMilliseconds()`
* `Date.prototype.setMilliseconds()`
Date.prototype.getUTCSeconds()
==============================

The **`getUTCSeconds()`** method of `Date` instances returns the seconds in the specified date according to universal time.

Try it
------

Syntax
------


```js
getUTCSeconds()
```

### Parameters

None.

### Return value

An integer, between 0 and 59, representing the seconds for the given date according to universal time. Returns `NaN` if the date is invalid.

Examples
--------

### Using getUTCSeconds()

The following example assigns the seconds portion of the current time to the variable `seconds`.


```js
const today = new Date();
const seconds = today.getUTCSeconds();
```

Specifications
--------------

| Specification |
| --- |
| ECMAScript Language Specification # sec-date.prototype.getutcseconds |

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.

See also
--------

* `Date.prototype.getSeconds()`
* `Date.prototype.setUTCSeconds()`
Date.prototype.toDateString()
=============================

The **`toDateString()`** method of `Date` instances returns a string representing the date portion of this date interpreted in the local timezone.

Try it
------

Syntax
------


```js
toDateString()
```

### Parameters

None.

### Return value

A string representing the date portion of the given date (see description for the format). Returns `"Invalid Date"` if the date is invalid.

Description
-----------

`Date` instances refer to a specific point in time. `toDateString()` interprets the date in the local timezone and formats the *date* part in English. It always uses the following format, separated by spaces:

1. First three letters of the week day name
2. First three letters of the month name
3. Two-digit day of the month, padded on the left a zero if necessary
4. Four-digit year (at least), padded on the left with zeros if necessary. May have a negative sign

For example: "Thu Jan 01 1970".

* If you only want to get the *time* part, use `toTimeString()`.
* If you want to get both the date and time, use `toString()`.
* If you want to make the date interpreted as UTC instead of local timezone, use `toUTCString()`.
* If you want to format the date in a more user-friendly format (e.g. localization), use `toLocaleDateString()`.
Examples
--------

### Using toDateString()


```js
const d = new Date(0);

console.log(d.toString()); // "Thu Jan 01 1970 00:00:00 GMT+0000 (Coordinated Universal Time)"
console.log(d.toDateString()); // "Thu Jan 01 1970"
```

Specifications
--------------

| Specification |
| --- |
| ECMAScript Language Specification # sec-date.prototype.todatestring |

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.

See also
--------

* `Date.prototype.toLocaleDateString()`
* `Date.prototype.toTimeString()`
* `Date.prototype.toString()`
Date.prototype.getMinutes()
===========================

The **`getMinutes()`** method of `Date` instances returns the minutes for this date according to local time.

Try it
------

Syntax
------


```js
getMinutes()
```

### Parameters

None.

### Return value

An integer, between 0 and 59, representing the minutes for the given date according to local time. Returns `NaN` if the date is invalid.

Examples
--------

### Using getMinutes()

The `minutes` variable has value `15`, based on the value of the `Date` object `xmas95`.


```js
const xmas95 = new Date("1995-12-25T23:15:30");
const minutes = xmas95.getMinutes();

console.log(minutes); // 15
```

Specifications
--------------

| Specification |
| --- |
| ECMAScript Language Specification # sec-date.prototype.getminutes |

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.

See also
--------

* `Date.prototype.getUTCMinutes()`
* `Date.prototype.setMinutes()`
Date.prototype.setYear()
========================

**Deprecated:** This feature is no longer recommended. Though some browsers might still support it, it may have already been removed from the relevant web standards, may be in the process of being dropped, or may only be kept for compatibility purposes. Avoid using it, and update existing code if possible; see the compatibility table at the bottom of this page to guide your decision. Be aware that this feature may cease to work at any time.

The **`setYear()`** method of `Date` instances sets the year for a specified date according to local time.

However, the way the legacy `setYear()` method sets year values is different from how the preferred `setFullYear()` method sets year values — and in some cases, also different from how `new Date()` and `Date.parse()` set year values. Specifically, given two-digit numbers, such as `22` and `61`:

* `setYear()` interprets any two-digit number as an offset to `1900`; so `date.setYear(22)` results in the year value being set to `1922`, and `date.setYear(61)` results in the year value being set to `1961`. (In contrast, while `new Date(61, 1)` also results in the year value being set to `1961`, `new Date("2/1/22")` results in the year value being set to `2022`; and similarly for `Date.parse()`).
* `setFullYear()` does no special interpretation but instead uses the literal two-digit value as-is to set the year; so `date.setFullYear(61)` results in the year value being set to `0061`, and `date.setFullYear(22)` results in the year value being set to `0022`.

Because of those differences in behavior, you should no longer use the legacy `setYear()` method, but should instead use the preferred `setFullYear()` method.

Syntax
------


```js
setYear(yearValue)
```

### Parameters

`yearValue`

An integer.

### Return value

Changes the `Date` object in place, and returns its new timestamp. If `yearValue` is `NaN` (or other values that get coerced to `NaN`, such as `undefined`), the date is set to Invalid Date and `NaN` is returned.

Description
-----------

 If `yearValue` is a number between 0 and 99 (inclusive), then the year for
 `dateObj` is set to `1900 + yearValue`. Otherwise, the year for
 `dateObj` is set to `yearValue`.

Examples
--------

### Using setYear()

The first two lines set the year to 1996. The third sets the year to 2000.


```js
const theBigDay = new Date();

theBigDay.setYear(96);
theBigDay.setYear(1996);
theBigDay.setYear(2000);
```

Specifications
--------------

| Specification |
| --- |
| ECMAScript Language Specification # sec-date.prototype.setyear |

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.

See also
--------

* Polyfill of `Date.prototype.setYear` in `core-js`
* `Date.prototype.getFullYear()`
* `Date.prototype.getUTCFullYear()`
* `Date.prototype.setFullYear()`
* `Date.prototype.setUTCFullYear()`
Date.prototype.setMonth()
=========================

The **`setMonth()`** method of `Date` instances changes the month and/or day of the month for this date according to local time.

Try it
------

Syntax
------


```js
setMonth(monthValue)
setMonth(monthValue, dateValue)
```

### Parameters

`monthValue`

An integer representing the month: 0 for January, 1 for February, and so on.

`dateValue` Optional

An integer from 1 to 31 representing the day of the month.

### Return value

Changes the `Date` object in place, and returns its new timestamp. If a parameter is `NaN` (or other values that get coerced to `NaN`, such as `undefined`), the date is set to Invalid Date and `NaN` is returned.

Description
-----------

If you do not specify the `dateValue` parameter, the same value as what is returned by `getDate()` is used.

If a parameter you specify is outside of the expected range, other parameters and the date information in the `Date` object are updated accordingly. For example, if you specify 15 for `monthValue`, the year is incremented by 1, and 3 is used for month.

 The current day of month will have an impact on the behavior of this method.
 Conceptually it will add the number of days given by the current day of the month to the
 1st day of the new month specified as the parameter, to return the new date.
 For example, if the current value is 31st January 2016, calling setMonth with a value of 1 will return 2nd March 2016.
 This is because in 2016 February had 29 days.

Examples
--------

### Using setMonth()


```js
const theBigDay = new Date();
theBigDay.setMonth(6);

//Watch out for end of month transitions
const endOfMonth = new Date(2016, 7, 31);
endOfMonth.setMonth(1);
console.log(endOfMonth); //Wed Mar 02 2016 00:00:00
```

Specifications
--------------

| Specification |
| --- |
| ECMAScript Language Specification # sec-date.prototype.setmonth |

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.

See also
--------

* `Date.prototype.getMonth()`
* `Date.prototype.setUTCMonth()`
Date.prototype.getTime()
========================

The **`getTime()`** method of `Date` instances returns the number of milliseconds for this date since the epoch, which is defined as the midnight at the beginning of January 1, 1970, UTC.

Try it
------

Syntax
------


```js
getTime()
```

### Parameters

None.

### Return value

A number representing the timestamp, in milliseconds, of this date. Returns `NaN` if the date is invalid.

Description
-----------

`Date` objects are fundamentally represented by a timestamp, and this method allows you to retrieve the timestamp. You can use this method to help assign a date and time to another `Date` object. This method is functionally equivalent to the `valueOf()` method.

### Reduced time precision

To offer protection against timing attacks and fingerprinting, the precision of `new Date().getTime()` might get rounded depending on browser settings. In Firefox, the `privacy.reduceTimerPrecision` preference is enabled by default and defaults to 2ms. You can also enable `privacy.resistFingerprinting`, in which case the precision will be 100ms or the value of `privacy.resistFingerprinting.reduceTimerPrecision.microseconds`, whichever is larger.


```js
// reduced time precision (2ms) in Firefox 60
new Date().getTime();
// 1519211809934
// 1519211810362
// 1519211811670
// …

// reduced time precision with `privacy.resistFingerprinting` enabled
new Date().getTime();
// 1519129853500
// 1519129858900
// 1519129864400
// …
```

Examples
--------

### Using getTime() for copying dates

Constructing a date object with the identical time value.


```js
// Since month is zero based, birthday will be January 10, 1995
const birthday = new Date(1994, 12, 10);
const copy = new Date();
copy.setTime(birthday.getTime());
```

### Measuring execution time

Subtracting two subsequent `getTime()` calls on newly generated `Date` objects, give the time span between these two calls. This can be used to calculate the executing time of some operations. See also `Date.now()` to prevent instantiating unnecessary `Date` objects.


```js
let end, start;

start = new Date();
for (let i = 0; i < 1000; i++) {
  Math.sqrt(i);
}
end = new Date();

console.log(`Operation took ${end.getTime() - start.getTime()} msec`);
```


**Note:** In browsers that support the Web Performance API's high-resolution time feature, `Performance.now()` can provide more reliable and precise measurements of elapsed time than `Date.now()`.

Specifications
--------------

| Specification |
| --- |
| ECMAScript Language Specification # sec-date.prototype.gettime |

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.

See also
--------

* `Date.prototype.setTime()`
* `Date.prototype.valueOf()`
* `Date.now()`
Date.prototype.setUTCMinutes()
==============================

The **`setUTCMinutes()`** method of `Date` instances changes the minutes for this date according to universal time.

Try it
------

Syntax
------


```js
setUTCMinutes(minutesValue)
setUTCMinutes(minutesValue, secondsValue)
setUTCMinutes(minutesValue, secondsValue, msValue)
```

### Parameters

`minutesValue`

An integer between 0 and 59 representing the minutes.

`secondsValue` Optional

An integer between 0 and 59 representing the seconds. If you specify `secondsValue`, you must also specify `minutesValue`.

`msValue` Optional

An integer between 0 and 999 representing the milliseconds. If you specify `msValue`, you must also specify `minutesValue` and `secondsValue`.

### Return value

Changes the `Date` object in place, and returns its new timestamp. If a parameter is `NaN` (or other values that get coerced to `NaN`, such as `undefined`), the date is set to Invalid Date and `NaN` is returned.

Description
-----------

 If you do not specify the `secondsValue` and
 `msValue` parameters, the values returned from
 `getUTCSeconds()` and
 `getUTCMilliseconds()` methods are
 used.

 If a parameter you specify is outside of the expected range,
 `setUTCMinutes()` attempts to update the date information in the
 `Date` object accordingly. For example, if you use 100 for
 `secondsValue`, the minutes will be incremented by 1
 (`minutesValue + 1`), and 40 will be used for seconds.

Examples
--------

### Using setUTCMinutes()


```js
const theBigDay = new Date();
theBigDay.setUTCMinutes(43);
```

Specifications
--------------

| Specification |
| --- |
| ECMAScript Language Specification # sec-date.prototype.setutcminutes |

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.

See also
--------

* `Date.prototype.getUTCMinutes()`
* `Date.prototype.setMinutes()`