Padonak Ср фев 01, 2023 17:45
Требуется подсчитать количество символов в слове
выхухоль:
- Код: Выделить всё
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title></title>
<style>
body{
background: #000 url('https://animalinfo.ru/wp-content/uploads/2021/11/dp0j8g_w4aaphnc.jpg') top center no-repeat;
}
div{
color: #fff;
font-weight: bold;
}
div span:first-of-type{
color: salmon;
text-transform: capitalize;
}
div span:last-of-type{
color: yellow;
}
</style>
<script>
onload = function(){
const o = {};
'выхухоль'.split('').forEach( x => o[x] ? o[x]++ : o[x] = 1 );
document.body.insertAdjacentHTML( 'afterbegin', Object.entries(o).map( n => `<div><span>${n.join('</span>: <span>')}</span></div>`).join('') );
}
</script>
</head>
<body>
</body>
</html>
Uncaught TypeError: 
