timeConverter(query, query2, ...arr) {
// start of the program, not working with return statement ... if (query.toLowerCase() == "days" || query2.toLowerCase() == "years") { let total = arr.map(x => (x / 360).toFixed(2)) console.log(${arr} days is + total + Years) } if (query.toLowerCase() == "days" || query2.toLowerCase() == "months") { let total = arr.map((x => x / 12)) console.log(${arr} days is + total + months) } if (query.toLowerCase() == "days" || query2.toLowerCase() == "hours") { let total = arr.map(x => x * 24) console.log(${arr} days is + total + hours) } if (query.toLowerCase() == "days" || query2.toLowerCase() == "minutes") { let total = arr.map(x => (x * 24 * 60)) console.log(${arr} days is + total + minutes) } if (query.toLowerCase() == "days" || query2.toLowerCase() == "seconds") { let total = arr.map(x => (x * 24 * 360)) console.log(${arr} days is ${total} seconds) }
}
Aucun commentaire:
Enregistrer un commentaire