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

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.

Getting the last element of a split string array

Getting the last element of a split string array

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

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

promise in javascript

promise in javascript

flatMap()

Use flatMap() creates a new array with sub-array elements flattened by specified depth.