For döngüsünü forEach'e çevirme


( ! ) Notice: Undefined index: description in /home/prototurk.com/public_html/app/controller/demo.php on line 171
Call Stack
#TimeMemoryFunctionLocation
10.0001360464{main}( ).../index.php:0
20.0028442312require( '/home/prototurk.com/public_html/app/controller/demo.php' ).../index.php:101

Prototürk'e geri dön
const items = ['item1', 'item2', 'item3']
const copyItems = []

// öncesi
for (let i = 0; i < items.length; i++) {
  copyItems.push(items[i])
}

// sonrası
items.forEach(function(item){
  copyItems.push(item)
})