Results in a string representation of yesterday's date in JavaScript

Published: 29 June 2021
on channel: Coding Hack
74
4

Use new Date() to get the current date.
Decrement it by one using Date.prototype.getDate() and set the value to the result using Date.prototype.setDate().
Use Date.prototype.toISOString() to return a string in yyyy-mm-dd format.

#Shorts #JavaScript #javascript #yesterday


Watch video Results in a string representation of yesterday's date in JavaScript online without registration, duration hours minute second in high quality. This video was added by user Coding Hack 29 June 2021, don't forget to share it with your friends and acquaintances, it has been viewed on our site 7 once and liked it people.