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

group by property javascript use reduce

group by property javascript use reduce

encode/decode base64 with JS

Encoding to base64 is done with the btoa command

Remove item in array javascript es6

Những bạn nào mà đã sử dụng ES6 một thời gian rồi thì có thể sử dụng method array.filter()

flatMap()

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

serialize Form

Sử dụng formdata constructor để convert form, FormData, array.from(). Kết hợp window.encodeURIComponent() để encode từng value trong form.