Javascript Date color()

Description

Javascript Date color()

Date.prototype.color = function(){
 return {//w w  w. j  a va2  s . c  om
  0: 'yellow',
  1: 'red',
  2: 'orange',
  3: 'purple',
  4: 'cyan',
  5: 'blue',
  6: 'green'
 }[this.getDay()]
}



PreviousNext

Related