Today on daily posts I will teach you how to make a Health app in JS
// Tiny Health Tracker
const health = {
water: 0,
steps: 0,
drink: () => health.water++ || console.log(`Drank water! Total: ${health.water}`),
walk: s => (health.steps += s) && console.log(`Walked ${s} steps! Total: ${health.steps}`),
stats: () => console.log(`Water: ${health.water} glasses | Steps: ${health.steps}`)
};
// Example usage:
health.drink(); // Drank 1 glass of water
health.walk(500); // Walked 500 steps
health.stats(); // Shows stats
Paste it into your compiler and it will work!
Thanks for looking at today’s daily post!
Top comments (2)
" uk49stoday.com Absolutely love how quick and accurate the results are on uk49stoday.com! The layout is super clean, and the predictions section has been surprisingly helpful. Keep up the great work — this is my go-to site for everything UK49s!
I recently came across UK49s Today, and I have to say, it’s uk49stoday.com/ one of the best resources out there for UK49s lottery enthusiasts. The site provides real-time results, smart predictions, and helpful tips that really give you an edge. What I love most is how consistently it’s updated and how easy it is to navigate.