i have an long const values below like this ,is it possible to create in function in typescript to reduce a long const.
export const DepartTime = [\'00.00\', \'
You can just use division by 2.
let DepartTime = [...Array(48)].map((e, i) => { return (i/2<10 ? '0' : '') + (i/2 - i/2 % 1) + (i/2 % 1 != 0 ? '.30' : '.00'); }); console.log(DepartTime);