2.7 KiB
		
	
	
	
	
	
	
	
			
		
		
	
	
			2.7 KiB
		
	
	
	
	
	
	
	
title, id, challengeType, videoUrl, localeTitle
| title | id | challengeType | videoUrl | localeTitle | 
|---|---|---|---|---|
| Iterated digits squaring | 5a23c84252665b21eecc7ec1 | 5 | Итерированные цифры в квадрате | 
Description
15 -> 26 -> 40 -> 16 -> 37 -> 58 -> 89 7 -> 49 -> 97 -> 130 -> 10 -> 1Напишите функцию, которая принимает число как параметр и возвращает 1 или 89 после выполнения указанного процесса.
Instructions
Tests
tests:
  - text: <code>iteratedSquare</code> должна быть функцией.
    testString: 'assert(typeof iteratedSquare=="function","<code>iteratedSquare</code> should be a function.");'
  - text: <code>iteratedSquare(4)</code> должен вернуть число.
    testString: 'assert(typeof iteratedSquare(4)=="number","<code>iteratedSquare(4)</code> should return a number.");'
  - text: <code>iteratedSquare(4)</code> должен вернуть <code>89</code> .
    testString: 'assert.equal(iteratedSquare(4),89,"<code>iteratedSquare(4)</code> should return <code>89</code>.");'
  - text: <code>iteratedSquare(7)</code> должен вернуть <code>1</code> .
    testString: 'assert.equal(iteratedSquare(7),1,"<code>iteratedSquare(7)</code> should return <code>1</code>.");'
  - text: <code>iteratedSquare(15)</code> должен вернуть <code>89</code> .
    testString: 'assert.equal(iteratedSquare(15),89,"<code>iteratedSquare(15)</code> should return <code>89</code>.");'
  - text: <code>iteratedSquare(20)</code> должен вернуть <code>89</code> .
    testString: 'assert.equal(iteratedSquare(20),89,"<code>iteratedSquare(20)</code> should return <code>89</code>.");'
  - text: <code>iteratedSquare(70)</code> должен вернуть <code>1</code> .
    testString: 'assert.equal(iteratedSquare(70),1,"<code>iteratedSquare(70)</code> should return <code>1</code>.");'
  - text: <code>iteratedSquare(100)</code> должен вернуть <code>1</code> .
    testString: 'assert.equal(iteratedSquare(100),1,"<code>iteratedSquare(100)</code> should return <code>1</code>.");'
Challenge Seed
function iteratedSquare (n) {
  // Good luck!
}
Solution
// solution required