7.1MviewsStack Overflow
Format a date in JavaScript without a library
toLocaleDateString formats a date for a locale (en-US, en-GB, en-CA) or a style such as dateStyle: 'long'. toISOString is UTC and can show the day before.
Arrays, dates and the everyday questions of the language, in the browser and in Node.js.
toLocaleDateString formats a date for a locale (en-US, en-GB, en-CA) or a style such as dateStyle: 'long'. toISOString is UTC and can show the day before.
indexOf finds the item and splice removes it in place; filter builds a new array without it. Check for -1 before you splice.
filter returns a new array, and the result was assigned back to a variable declared with const.
JavaScript arrays have no remove method.