Forums

Give help. Get help.

  • # April 14, 2018 at 9:24 pm

    I tried in the console Date.prototype.getDay and it return the correct getDay function. but after doing this Date.prototype.getDay(), it return error.
    Error is “Uncaught TypeError: this is not a Date object.”
    Why it’s giving error?

    # April 15, 2018 at 7:54 am
     var time = new Date();
     var wkday = [0,"sun",1,"mon",2,"tues",3,"wed",4,"thurs",5,"fri",6,"sat"]
     var check = time.getDay();
     console.log ( "today is " + wkday[check + 1] );
    
Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.

icon-anchoricon-closeicon-emailicon-linkicon-logo-staricon-menuicon-nav-guideicon-searchicon-staricon-tag