Array Methods in JavaScript

Tiffany White,

for (var i = 0; i < array.length; i++) { var index = array[i]; console.log('Index: ', index); }

array.forEach(function(item, index) { console.log(item); });

var odd = even.map(function(num) { return num + 1; });

<span class=&quot;kd&quot;>var</span> <span class=&quot;nx&quot;>jsGreet</span> <span class=&quot;o&quot;>=</span> <span class=&quot;nx&quot;>greetArr</span><span class=&quot;p&quot;>.</span><span class=&quot;nx&quot;>concat</span><span class=&quot;p&quot;>(</span><span class=&quot;nx&quot;>jsArr</span><span class=&quot;p&quot;>);</span>

<span class=&quot;nx&quot;>console</span><span class=&quot;p&quot;>.</span><span class=&quot;nx&quot;>log</span><span class=&quot;p&quot;>(</span><span class=&quot;nx&quot;>jsGreet</span><span class=&quot;p&quot;>);</span>

© tiff.RSS