Create boolean helper functions that describe a number.
Given a number, return a small report describing what kind of number it is. Use simple boolean helper functions, then combine their results in describeNumber.
Write these functions:
isPositive(number) should return true when the number is greater than 0.
isNegative(number) should return true when the number is less than 0.
isZero(number) should return true when the number is exactly 0.
isEven(number) should return true when the number is even.
describeNumber(number) should return an object with positive, negative, zero, even, and odd properties.
Sample checks:
Expected output:
Each checker function should return a boolean. The summary function should return a new object.
Join the Community
roadmap.sh is the most starred project on GitHub and is visited by hundreds of thousands of developers every month.
Roadmaps Best Practices Guides Videos FAQs YouTube
roadmap.sh by @kamrify @kamrify
Community created roadmaps, best practices, projects, articles, resources and journeys to help you choose your path and grow in your career.
Login or Signup
You must be logged in to perform this action.