Hàm lày ngày trong tuần javascript

tipjs,date,function

Hàm lày ngày trong tuần javascript

const getWhatDay = () => {
  return new Date().getDay() ? new Date().getDay() : 7
}
console.log(getWhatDay());//3

Có thể bạn đã miss một số snippets code

formatdate js

JavaScript’s Date() function object contains a long list of methods that can be used to manipulate the date outcome

Calculate the number of difference days between two dates

Calculate the number of difference days between two dates

using javascript callback style error handling

JavaScript: async/await with forEach

JavaScript: async/await with forEach()

Rest Operator for Objects

Now we can use rest on the properties of an Object. It allows us to explicitly extract certain named variables, and assign any uncalled variables into a catchall Object.