Создать массив с индексов массива 
		
		
		
		Функция getOutdated принимает массив роботов robots и возвращает массив индексов для роботов, у которых core_version меньше новой версии newVersion ПО. 
	Пример: const robots = [{core_version: 9}, {core_version: 13}, {core_version: 16}, {core_version: 9}, {core_version: 14}]; getOutdated(robots, 10) === [0, 3] getOutdated(robots, 14) === [0, 1, 3] getOutdated(robots, 8) === [] getOutdated(robots, 18) === [0, 1,] ************************************************** *** function getOutdated(robots, newVersion) { var indexes = []; for(let i = 0; i < robots.length; i++){ if(robots[i].core_version< newVersion){ robots[i].core_version =0; } var index = robots.indexOf( {core_version: 0 ); /:help: while ( index != -1 ) { indexes.push( index ); index = robots.indexOf( searchElement, index + 1 ); } return index; } } getOutdated ([{core_version: 13}, {core_version: 16}, {core_version: 9}, {core_version: 14}], 15); ********************************** function getOutdated(robots, newVersion) { var indexes = []; for(let i = 0; i < robots.length; i++){ if(robots[i].core_version< newVersion){ return i; } } } getOutdated ([{core_version: 13}, {core_version: 16}, {core_version: 9}, {core_version: 14}], 15); но как записать і в массив?  | 
	
		
 OlesiaBOM, 
	
<script>
const robots = [{core_version: 9}, {core_version: 13}, {core_version: 16}, {core_version: 9}, {core_version: 14}];
const getOutdated = (robots, newVersion) => robots.filter(({core_version}) => core_version < newVersion).map(obj => robots.findIndex (el => el === obj))
document.write(getOutdated(robots, 14))
  </script>
 | 
	
		
 OlesiaBOM, 
	Пожалуйста, отформатируйте свой код! Для этого его можно заключить в специальные теги: js/css/html и т.п., например: [html run] ... минимальный код страницы с вашей проблемой [/html] О том, как вставить в сообщение исполняемый javascript и html-код, а также о дополнительных возможностях форматирования - читайте http://javascript.ru/formatting.  | 
	
		
 Цитата: 
	
 indexes.push(i); //... return indexes  | 
	
		
 function getOutdated(robots, newVersion) { 
	var element = "[object Object]*"; var indices = []; for(var i = 0; i < robots.length; i++){ if(robots[i].core_version< newVersion){ robots[i]+='*'; } } var idx = robots.indexOf(element); while (idx != -1) { indices.push(idx); idx = robots.indexOf(element, idx + 1); } console.log(indices); } getOutdated ([{"core_version":4},{"core_version":7},{"core_versi on":18},{"core_version":3},{"core_version":15},{"c ore_version":8},{"core_version":5},{"core_version" :6}], 18);  | 
| Часовой пояс GMT +3, время: 13:30. |