MrFlatman,
<script>
"use strict"
function IsSquare(K)
{
K = Math.sqrt(K);
return K == (K|0)
}
var arr = Array.from({length : 10}, function() {
return 1 + 100 * Math.random()|0
})
document.write(JSON.stringify(arr))
arr = arr.filter(IsSquare);
document.write(JSON.stringify(arr))
</script>