Loading, please wait ...
Open its course - Web Engineering

Short Questions for Document Object Model and Basics of Javascript

  • 1 Write a javascript program to print the Friday's count on 14 August among years 2000 to 3000.

    Answer

    var fridaysCount =0;

    for(year=2000;year<=3000;year++)

    {

    var dt=new Date(year,7,14);

    if(dt.getDay() == 4)

    fridaysCount++;

    }

    document.write("Total Fridays on Aug 14 between 2000 to 3000 are "+fridaysCount);




Contact Us

support@subexpert.com
Write to Us View Help
Subject Expert Logo

Subject Expert

Learn, Evaluate and Optimize

Follow Us
Facebook Switch Display Mode Enable Translation
© 2024 - Subject Expert