SkillSeevaSkillSeeva
HomeResourcesScheduleRoadmapTeam
Back to Categories
Current Path
JavaScript
Syntax & VariablesOperatorsFunctionsObjectsEventsString MethodsArrays & MethodsDate & MathLogic (If/Switch/Loops)DOM ManipulationES6+ FeaturesScope & HoistingThe 'this' KeywordJS ModulesClassesAsync/Await & PromisesDebuggingWeb APIs (Fetch, Storage)JSON
Jump to topic:
Syntax & VariablesOperatorsFunctionsObjectsEventsString MethodsArrays & MethodsDate & MathLogic (If/Switch/Loops)DOM ManipulationES6+ FeaturesScope & HoistingThe 'this' KeywordJS ModulesClassesAsync/Await & PromisesDebuggingWeb APIs (Fetch, Storage)JSON

Date & Math

Handling dates and math operations.
javascript
const d = new Date();
let year = d.getFullYear();

Math.PI;      // 3.141592653589793
Math.round(4.7);    // 5
Math.ceil(4.4);     // 5
Math.floor(4.7);    // 4
Math.random();      // 0 to 1
8 / 19