Guest User

Untitled

a guest
Oct 20th, 2017
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. let video = [];
  2. this.service.nextVideo().subscribe( response =>
  3. {
  4. response.array.forEach(element => {
  5. video.push(element.videoId);
  6. });
  7. })
  8. console.log(video[0]); //Output is undefined
  9.  
  10. let video = [];
  11. this.service.nextVideo().subscribe( response =>
  12. {
  13. response.array.forEach(element => {
  14. video.push(element.videoId);
  15. console.log(video[0]);
  16. });
  17. })
Add Comment
Please, Sign In to add comment