Добавить
Уведомления

String Interpolation in Javascript | Concatenate Multiple Variables

Concatenate multiple variables using String Interpolation in Javascript. Notes: - The function does not print or console log anything, but rather returns the Weather Report String - I created this video on 26-7-2020. Why did the date print out as 27-6-2020? There are 2 reasons: 1) The month of a js Date object is indexed 0-11. So, the 6 represents the 7th month which is July (I should have added 1 to the month in my print statement). 2) When declaring a new js Date, the default time zone is UTC. It was still the 26th for my local time zone, but the 27th UTC. You can make adjustments to offset this issue. https://stackoverflow.com/questions/15141762/how-to-initialize-a-javascript-date-to-a-particular-time-zone

12+
16 просмотров
2 года назад
12+
16 просмотров
2 года назад

Concatenate multiple variables using String Interpolation in Javascript. Notes: - The function does not print or console log anything, but rather returns the Weather Report String - I created this video on 26-7-2020. Why did the date print out as 27-6-2020? There are 2 reasons: 1) The month of a js Date object is indexed 0-11. So, the 6 represents the 7th month which is July (I should have added 1 to the month in my print statement). 2) When declaring a new js Date, the default time zone is UTC. It was still the 26th for my local time zone, but the 27th UTC. You can make adjustments to offset this issue. https://stackoverflow.com/questions/15141762/how-to-initialize-a-javascript-date-to-a-particular-time-zone

, чтобы оставлять комментарии