write the code higher order function instead of usual loops/iterators : <p>Can anyone tell me how to write this below code using higher order functions.</p>

<pre><code>var x = 10
while (x &lt; =10)
{
if (x &lt;= 5)
print(x)
x = x+1
}
</code></pre>
