Skip to content

Commit

Permalink
push3
Browse files Browse the repository at this point in the history
  • Loading branch information
HarshS16 committed Nov 2, 2024
1 parent 5c3fead commit 60a9523
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 3 deletions.
6 changes: 3 additions & 3 deletions 01_basics/06_nums.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,16 @@ const hundreds= 100000000
//rounds off to nearest max value(6.05--->7)
//console.log(Math.floor(6.95));
//rounds off to nearest min value(6.95---->6)
console.log(Math.min(3,4,8,9,1));
//console.log(Math.min(3,4,8,9,1));
//returns minimum element of array
console.log(Math.max(3,4,8,9,1));
//console.log(Math.max(3,4,8,9,1));
//returns maximum element of array
console.log(Math.random());
console.log((Math.random()*10)+1);
console.log(Math.floor(Math.random()*10)+1);
const min=10
const max=20
console.log(Math.floor(Math.));
console.log(Math.floor(Math.random() * (max-min+1))+min);



Expand Down
31 changes: 31 additions & 0 deletions 01_basics/07_dates.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
// Dates

let myDate = new Date()
// console.log(myDate.toString());
// console.log(myDate.toDateString());
// console.log(myDate.toLocaleString());
// console.log(typeof myDate);

// let myCreatedDate = new Date(2023, 0, 23)
// let myCreatedDate = new Date(2023, 0, 23, 5, 3)
// let myCreatedDate = new Date("2023-01-14")
let myCreatedDate = new Date("01-14-2023")
// console.log(myCreatedDate.toLocaleString());

let myTimeStamp = Date.now()

// console.log(myTimeStamp);
// console.log(myCreatedDate.getTime());
// console.log(Math.floor(Date.now()/1000));

let newDate = new Date()
console.log(newDate);
console.log(newDate.getMonth() + 1);
console.log(newDate.getDay());

// `${newDate.getDay()} and the time `

newDate.toLocaleString('default', {
weekday: "long",

})

0 comments on commit 60a9523

Please sign in to comment.