Advertisement
Guest User

Untitled

a guest
May 20th, 2020
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. function solution(input){
  2.  
  3. let age = Number(input.shift())
  4.  
  5.  
  6. if (age >= 0 && age <= 2) {
  7. console.log(`baby`)
  8.  
  9. }else if(age >= 3 && age <= 13){
  10. console.log(`child`)
  11.  
  12. }else if(age >= 14 && age <= 19){
  13. console.log(`teenager`)
  14.  
  15. }else if(age >= 20 && age <= 65){
  16. console.log(`adult`)
  17.  
  18. }else if(age >= 66){
  19. console.log(`elder`)
  20.  
  21. }else{
  22. console.log(`out of bounds`)
  23. }
  24.  
  25. }
  26.  
  27. solution([0])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement