« first day (4060 days earlier)      last day (873 days later) » 

3:04 AM
 
 
10 hours later…
user17382064
12:42 PM
This is wrong.

  function findPlayers() {
    const allCovers = document.querySelectorAll(".cover");
    const allWrappers = document.querySelectorAll(".wrap");
    allWrappers.forEach(function addToPlayers(cover, index) {
    cover:index,
    wrapper:index
    });
  }
 
user17382064
Inside of the addToPlayers loop, I need to push to the players array an object. That object consists of a property called cover, and a property called wrapper.
 
user17382064
I should be using index to reference an item from the allCovers array.

I should be using index to reference an item from the allWrappers array.
 
user17382064
How do I do this?
 
user17382064
This is the players array: const players = [];
 
user17382064
I am stuck on this.
 
2:09 PM
@htmlcssjava321 interesting, players.push({key,value}) is the way to insert any object
 
2:26 PM
@htmlcssjava321 Please don't post unformatted code - use the up arrow to edit your post, then hit Ctrl + K to format the code in that post. See the faq. You have 25 seconds to edit and format your message properly before it will be removed. Please separate code blocks from your actual question. Put your question in 1 message and then your code in a 2nd and format it.
For posting large code blocks, use a paste site like like gist.github.com, hastebin.com, pastie.org or a demo site like jsbin.com
 
user17382064
I think I did this wrong.
 
user17382064
  function findPlayers() {
    const allCovers = document.querySelectorAll(".cover");
    const allWrappers = document.querySelectorAll(".wrap");
    allWrappers.forEach(function addToPlayers(cover, index) {
      players.push({
        cover,
        index
      })
      players.push({
        wrap,
        index
      })
    });
  }
 
@htmlcssjava321 you need to put key and value
players.push({
wrap:index
})
 
user17382064
Like this then.
 
user17382064
  function findPlayers() {
    const allCovers = document.querySelectorAll(".cover");
    const allWrappers = document.querySelectorAll(".wrap");
    allWrappers.forEach(function addToPlayers(cover, index) {
      players.push({
        cover: index
      })
      players.push({
        wrap: index
      })
    });
  }
 
2:36 PM
yes and you can do console.log(players) and show what's the data printed
 
@HabibRehman Please don't post unformatted code - use the up arrow to edit your post, then hit Ctrl + K to format the code in that post. See the faq. You have 25 seconds to edit and format your message properly before it will be removed. Please separate code blocks from your actual question. Put your question in 1 message and then your code in a 2nd and format it.
1 message moved to Trash can
 
:53537066 also i believe the index should be on the left side, sorry my bad before
    players.push({
       index:cover
    })
    players.push({
      index:wrap
    })
 
@HabibRehman Please don't post unformatted code - use the up arrow to edit your post, then hit Ctrl + K to format the code in that post. See the faq. You have 25 seconds to edit and format your message properly before it will be removed. Please separate code blocks from your actual question. Put your question in 1 message and then your code in a 2nd and format it.
@HabibRehman Please don't post unformatted code - use the up arrow to edit your post, then hit Ctrl + K to format the code in that post. See the faq. You have 25 seconds to edit and format your message properly before it will be removed. Please separate code blocks from your actual question. Put your question in 1 message and then your code in a 2nd and format it.
 
user17382064
wrap is not defined
 
user17382064
  function findPlayers() {
    const allCovers = document.querySelectorAll(".cover");
    const allWrappers = document.querySelectorAll(".wrap");
    allWrappers.forEach(function addToPlayers(cover, index) {
      players.push({
        index: cover
      })
      players.push({
        index: wrap
      })
    });
  }
 
user17382064
 
yea where are you getting wrap from?
like for cover you have made it like this
const cover = playButton.parentElement;
what's for wrap?
 
user17382064
Didn't you say index goes on the left side?
 
user17382064
players.push({
   index:cover
})
players.push({
  index:wrap
})
 
user17382064
I'm confused now.
 
index value is same
so it was getting overridden
but i don't see any use of these pused values in players
need to know where are you going to use these and how
at the moment it isn't clear for me how are they going to be used, sorry for making you confuse forget what i said about the positions
 
2:56 PM
Howdy guys
& gals
 
I'm good how are you Lime
How one can have a profile like Lime <3
 
 
7 hours later…
10:01 PM
clearing browser cache prevents a lot of head ache
 

« first day (4060 days earlier)      last day (873 days later) »