Javascript examples for Array Operation:Array Element
Get array element by today's date
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <script type="text/javascript"> window.onload=function(){//w w w.j a v a 2 s .c o m var today = new Date(), weekday = [ "A", "B", "C", "D", "E", "F", "G" ]; var hoy = weekday[today.getDay()]; console.log(hoy); } </script> </head> <body> </body> </html>