get day in google app script 1

get day in google app script

const weekdays = ["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];
weekdays[new Date().getDay()]

Here is what the above code is Doing:
1. We create a variable called weekdays and assign it an array of strings.
2. We use the getDay() method to get the current day of the week.
3. We use the getDay() method’s return value to access the current day of the week in the weekdays array.

Similar Posts