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

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()

How to reverse an Array?

Reversing an array in JS is really simple with the standard array method. Like below

Sử dụng reduce và concat làm phẳng một array

Array.reduce() và Array.concat() có thể giúp chúng ta làm phẳng một Array như:

closure javascript

closure javascript

Calculate the number of difference days between two dates

Calculate the number of difference days between two dates