chester,
<!DOCTYPE html>
<html>
<head>
<title>Untitled</title>
<meta charset="utf-8">
</head>
<body>
<div class="wrap">
<div class="num">1</div>
<div class="num">2</div>
<div class="num">3</div>
<div class="num">4</div>
<div class="num">5</div>
</div>
<script>
const array = Array.from(document.getElementsByClassName('num'), ({firstChild : {data}}) => Number(data));
alert(JSON.stringify(array));
</script>
</body>
</html>
ну и классика ...
<!DOCTYPE html>
<html>
<head>
<title>Untitled</title>
<meta charset="utf-8">
</head>
<body>
<div class="wrap">
<div class="num">1</div>
<div class="num">2</div>
<div class="num">3</div>
<div class="num">4</div>
<div class="num">5</div>
</div>
<script>
const divs = document.getElementsByClassName('num');
const array = [];
for (let i = 0; i < divs.length; i++) { array.push(+divs[i].textContent)}
alert(JSON.stringify(array));
</script>
</body>
</html>