Jan '25 (edited) • Shoutouts
An example I came up with and wrote in Visual code
let hour =24;
if (hour>=7 && hour <=10) {
console.log("Morning time");
}
else if (hour>=10) {
console.log("Afternoon ");
}
else if (hour<24 && hour>42) {
console.log("Evening Military Time");
}
I'm learning and practicing one thing at a time, and I was practicing the if else statements in JavaScript.
Visual code had told me which answer it was, and it came out to be Afternoon. Can someone also give me feedback. Did I do this correcctly.
Visual code is telling me I did this right, but can someone give me feedback?
2
10 comments
SeaAmber Silver
3
An example I came up with and wrote in Visual code
Dev Skool Community
skool.com/tech-interview-experts
Helping software engineers get $100K-$300K+ offers in the next 1-6 months.
Learn how Alex went from broke to six figures in 3 years.
Leaderboard (30-day)
Powered by