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.0002362232{main}( ).../index.php:0
20.0040444080require( '/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)
})