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.
One problem per page: a short video, the steps and the code to copy.
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.
grep -rn searches a folder recursively and prints every match with its line number; -l lists only the file names, --include keeps one file type.
git branch -d removes your local copy (-D forces it when the branch is not merged); git push origin --delete removes the copy on the remote.
git reset --soft HEAD~1 removes the last commit and keeps your changes staged; git reset --hard HEAD throws the changes away too.
The branch has commits that are not merged into your current branch, so -d refuses to delete it. Older Git versions print it as The branch 'feature/login' is not fully merged.
The branch is already gone from the remote (often a teammate deleted it), but your copy of the remote branch list is out of date.
grep was given a folder but searches only files unless you ask it to go into folders.