Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- *
- * @param {year} a
- * @param {month} b
- * @param {date} c
- */
- function solve(a, b,c){
- const d = new Date(a, b, c);
- const year = d.getFullYear(a);
- const date = d.getDate(c)+1;
- const month = d.getMonth(b) ;
- const formatted = `${year}- ${month}- ${date}`
- console.log(formatted);
- }
- solve(2016, 9, 30);
- solve(2020, 3, 24);
Advertisement
Add Comment
Please, Sign In to add comment