freeCodeCamp/curriculum/challenges/arabic/08-coding-interview-prep/rosetta-code/happy-numbers.arabic.md

1.7 KiB

title id challengeType videoUrl localeTitle
Happy numbers 594810f028c0303b75339ad1 5

Description

undefined

Instructions

undefined

Tests

tests:
  - text: ''
    testString: 'assert(typeof happy === "function", "<code>happy</code> is a function.");'
  - text: ''
    testString: 'assert(typeof happy(1) === "boolean", "<code>happy(1)</code> should return a boolean.");'
  - text: ''
    testString: 'assert(happy(1), "<code>happy(1)</code> should return true.");'
  - text: ''
    testString: 'assert(!happy(2), "<code>happy(2)</code> should return false.");'
  - text: ''
    testString: 'assert(happy(7), "<code>happy(7)</code> should return true.");'
  - text: ''
    testString: 'assert(happy(10), "<code>happy(10)</code> should return true.");'
  - text: ''
    testString: 'assert(happy(13), "<code>happy(13)</code> should return true.");'
  - text: ''
    testString: 'assert(happy(19), "<code>happy(19)</code> should return true.");'
  - text: ''
    testString: 'assert(happy(23), "<code>happy(23)</code> should return true.");'
  - text: ''
    testString: 'assert(happy(28), "<code>happy(28)</code> should return true.");'
  - text: ''
    testString: 'assert(happy(31), "<code>happy(31)</code> should return true.");'
  - text: ''
    testString: 'assert(happy(32), "<code>happy(32)</code> should return true:.");'
  - text: ''
    testString: 'assert(!happy(33), "<code>happy(33)</code> should return false.");'

Challenge Seed

function happy (number) {
  // Good luck!
}

Solution

// solution required