nastya97core,
<!doctype html>
<html lang="ru">
<head>
<meta charset="UTF-8">
<title>Document</title>
<style type="text/css">
div{
height: 100px;
width: 100px;
margin: 5px;
text-align: center;
line-height: 100px;
}
body{
display: flex;
justify-content: center;
}
.red{
background-color: #FF0000;
}
</style>
</head>
<body>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<script>
function qs(e){return document.querySelectorAll(e)};
function qsf(e){
const fn = callback => (NodeList.prototype.forEach.bind(qs(e))(callback), fn);
return fn};
qsf('div')
(el => el.classList.add("red"))
((el,i) => el.textContent = i)
(({style}) => style.color = '#fff');
</script>
</body>
</html>