Skip to content
Advertisement

javascript how do i get .data info within a function with forEach function? [closed]

playing around with foreach fuction atm, and trying to get .data out of it.

JavaScript

okay so right now it outputs:

JavaScript

and it does makes sense since i haven’t giving ‘head’ any data yet. But is it possible to give ‘head’ data within ‘myarray’?

Advertisement

Answer

Problem is with your array as it does not contain data that you are trying to access. check updated code below

JavaScript
User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement