set(0, 0, 1);
a.set(2, 1, 1);
var count = a.countNeighbors(1, 1, function(value) return value == 1); //outputs 2
</code></pre></div></div><div class="field "><a name="forEach"></a><h3 class="anchor"><code><span class="label label-inline">inline</span><a href="#forEach"><span class="identifier">forEach</span></a> (<span style="white-space:nowrap">f:<span class="type">T</span>&nbsp;&#8209;&gt;&nbsp;<span class="type">Int</span>&nbsp;&#8209;&gt;&nbsp;<span class="type">Int</span>&nbsp;&#8209;&gt;&nbsp;<span cl