Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- let video = [];
- this.service.nextVideo().subscribe( response =>
- {
- response.array.forEach(element => {
- video.push(element.videoId);
- });
- })
- console.log(video[0]); //Output is undefined
- let video = [];
- this.service.nextVideo().subscribe( response =>
- {
- response.array.forEach(element => {
- video.push(element.videoId);
- console.log(video[0]);
- });
- })
Add Comment
Please, Sign In to add comment