Array.prototype.slice.call( document.querySelectorAll('.test-block') ).forEach(function (element) {
console.log(1);
})
let blocks = document.querySelectorAll('.test-block')
if (blocks)
[].forEach.call(blocks, testBlock)
function testBlock() {
console.log(1);
}