sample test

dev test
mail@pastecode.io avatar
unknown
javascript
3 years ago
417 B
1
Indexable
Never
var months = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'];
var input ="0102-0207";
const [start,end]=input.split('-');
let startMonth=months[Number(start.substring(2))-1];
let endMonth=months[Number(end.substring(2))-1];
console.log(startMonth,endMonth);
const s =`01 ${startMonth}`; 
const e = `02 ${endMonth}`;
console.log(s+" and "+e);