Rise,
<!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 class="item">
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
</div>
<script>
function qsa(selector, parent) {
return (parent || document).querySelectorAll(selector)
}
function qsf(...e) {
const fn = callback => (NodeList.prototype.forEach.bind(qsa(...e))(callback), fn);
return fn
};
let parent = qsa('.item')[0];
qsf('div', parent)
(el => el.classList.add("red"))
((el, i) => el.append(i))
(({style}) => style.color = '#fff');
</script>
</body>
</html>