« first day (4064 days earlier)      last day (867 days later) » 

user17382064
6:06 AM
I was given these instructions. "The undefined wrapper can now have undefined replaced with an index into the allWrappers array."
 
user17382064
How do I do that in here?
 
user17382064
 function findPlayers() {
    const allCovers = document.querySelectorAll(".cover");
    const allWrappers = document.querySelectorAll(".wrap");
    allWrappers.forEach(function addToPlayers(cover, index) {
      players.push({
       "covers": cover,
       "wrapper": undefined
      });
    });
  }
 
user17382064
Then I was given these to read.

https://developer.mozilla.org/en-US/docs/Learn/JavaScript/First_steps/Arrays

https://www.javascripttutorial.net/javascript-array/

https://www.freecodecamp.org/news/the-javascript-array-handbook/
 
user17382064
After reading those, I still don't know how to do this: "The undefined wrapper can now have undefined replaced with an index into the allWrappers array."
 
user17382064
Kevin, can you help me figure this out?
 
user17382064
6:11 AM
I have been stuck on this for days.
 
user17382064
Is anyone able to help?
 
6:33 AM
the wording is unclear to me
The code also seems a little unclear
what it calls cover in the forEach, is... a wrapper
not a cover
presumably, it wants you to place wrapper in wrapper, and cover in cover. and if you can assume the indexes in the html match, then you can use the index of the forEach to get the cover from the allCovers collection.
 
user17382064
The code is here, but I am not sure that will help. jsfiddle.net/u1mjfwqe
 
user17382064
6:49 AM
What you said, how would that be done in here?
 
user17382064
 function findPlayers() {
    const allCovers = document.querySelectorAll(".cover");
    const allWrappers = document.querySelectorAll(".wrap");
    allWrappers.forEach(function addToPlayers(cover, index) {
      players.push({
       "covers": cover,
       "wrapper": undefined
      });
    });
  }
 
user17382064
This line would: "wrapper": undefined

Would be changed to what?
 
stackoverflow.com/a/70169932/4826457 is there a specific use for a while loop here? I don't see it.
 
user17382064
I was told: "nothing gets updated other than the wrapper property line."
 
user17382064
Which is this: "wrapper": undefined
 
user17382064
6:56 AM
What would that be changed to?
 
user17382064
"Undefined gets replaced with an index into the allWrappers array."
 
user17382064
@KevinB How do I do that in the code? "wrapper": undefined would be changed to what?
 
allWrappers[index]
Which is exactly equal to cover, btw
But strictly following the directions as you describe them, that’s the answer
@SurajRao it’s entirely useless
It can be simplified to an if statement, but even then it doesn’t accomplish anything
 
7:15 AM
Yeah.. They are already doing var lastelement = last[last.length - 1]; before the loop...
 
Well, correction
 
Just a poor answer then.
 
In if statement form it can be useful
But it’d need to be before var lastElement
 
sending null instead of undefined?
 
So technically, even though doing this with a while loop is dumb, if it came first in the function, it’d do something useful
It’d return null for an empty array rather than undefined, if that’s useful for the usecase
 
7:19 AM
It would only send null in place of undefined. I suppose works in scenarios where you need to distinguish between the two.
 
!!> let x = []; return x[-1];
 
@KevinB undefined Logged: [ ] Took: 0ms
 
I prefer having null for cases where I want to explicitly mark "this doesn't exist". undefined is the implicit one but I feel like when I'm trying to convey "yes, I did try to find the thing but I didn't" rather than "I tried to find it. Dunno what happened, open this box and see if it's empty or not - that would tell you if I succeeded"
 
user17382064
:53560807       Like this: players.push({
        "covers": cover,
        "allWrappers": [index]
      });
 
No
 
7:21 AM
It also fails if last itself is null/undefined :p
 
Exactly as I wrote it
 
user17382064
How do I fix the curly brackets at the end?
 
user17382064
  function findPlayers() {
    const allCovers = document.querySelectorAll(".cover");
    const allWrappers = document.querySelectorAll(".wrap");
    allWrappers.forEach(function addToPlayers(cover, index) {
      const allWrappers = [index];
      players.push({
        "covers": cover,
        allWrappers[index]
       });
    });
  }
 
@SurajRao That's true. TBH, I don't like having both undefined and null especially since they often can mean the same thing. There isn't really a good value to use for explicitly "actually not found" as opposed to "it's found and the value signifies a missing value"
 
user17382064
 
7:25 AM
Using something like Java's Optional makes a lot more sense because it can actually distinguish between the two.
 
user17382064
I'm getting errors.
 
user17382064
@KevinB These are the errors I am getting. i.imgur.com/EtpccLT.png
 
I mean
You still didn’t write valid JavaScript
 
user17382064
Like this?
 
user17382064
  function findPlayers() {
    const allCovers = document.querySelectorAll(".cover");
    const allWrappers = document.querySelectorAll(".wrap");
    allWrappers.forEach(function addToPlayers(cover, index) {
      const allWrappers = [index];
      players.push({
        "covers": cover,
        allWrappers: [index]
       });
    });
  }
 
7:30 AM
look up what object literals look like
And then replace undefined with what I gave you
I don’t understand how you got lost there
Objects are a core JavaScript feature
 
user17382064
This is wrong then: allWrappers: [index]
 
It’s valid JavaScript but surely it’s not what your assignment wants.
What are the brackets for in that solution?
 
user17382064
You added them like this: allWrappers[index]
 
Right
And what do they do in my sample?
 
user17382064
creates the array
 
7:35 AM
If you don’t understand the code I provided, what good does me providing it do
 
user17382064
They are used to define literals. []
 
They have another purpose
 
user17382064
They are used to retrieve or set the value for a given key in a dictionary.
 
@KevinB Hahahahaaaaaa. and still you visit web
 
@ndotie Welcome to the JavaScript chat! Please review the room rules. If you have a question, just post it, and if anyone's free and interested they'll help. If you want to report an abusive user or a problem in this room, visit our meta.
 
user17382064
7:43 AM
Is that right?
 
Yes
 
 
3 hours later…
11:01 AM
````
https://stackoverflow.com/a/50655259/5893921

was going through this answer and the throttle function has a context. Which context is the throttled function (the new function which we wrap in `throttle` function) using in this case
It is giving me the global object everytime
 
 
1 hour later…
12:16 PM
Can we call CSS properties from variable like: var reed = border;
then we can use this variable like: e.style.reed = "2px solid red"
Like we can take property which we want to change from the data-* and then used it while defining properties.
 
1:01 PM
The problem is that I have same 3 function but change in just border, outline, color. So thinking to reduce that to 1 function and take these values from data-*
 
1:16 PM
Yes
it’s an object with properties
 
you probably will have to use string there though.
 
1:35 PM
@illiteratewriter As always, it depends on how it's called: jsbin.com/jeraqobowi/1/edit?js,console
 
But it is not changing the property value when using a variable: Here is a fiddle to show that
 
reed is a variable containing object key.
You access like so: object[reed]
 
1:51 PM
Can you tell what will be the changes plz
 
e.style[reed] = "2px solid red"
 
Wow, thanks a lot @SurajRao. But can you tell why directly calling it don't make it work
 
calling it means you are looking for the key reed in style.
You need to look for the value of reed in style i.e style.color
or style.border etc
 
Can a you tell a little more plz or where can I find these in more details (key especially)
 
2:39 PM
Why do I get a undefined?
teamData.forEach(function(team, i){
	teamData[i].Employees.includes(currentUser);
  return teamData.Team;
})
 
2:50 PM
forEach doesn't return anything. Also you never use the value of teamData[i].Employees.includes(currentUser). The callback basically does nothing.
And teamData[i] is unneeded, since you already have team passed into the callback.
 
So the false I am getting is because the forEach doesn't return anything
 
||> [1, 2, 3].forEach(x => "whatever")
 
@VLAZ undefined Logged: [ ] Took: 0ms
 
o.0
const team = teamData.filter(function(team, i){
	teamData[i].Employees.includes(currentUser);
  return team;
})

console.log(team)
Now I am getting the entire teamData as a response.
 
You still don't do anything with the result of teamData[i].Employees.includes(currentUser);
 
3:09 PM
damnit
 
4:02 PM
function getTeam(){
	const team = teamData
  	.filter(team => team.Employees.includes(currentUser))
		.map(team => team.Team);
		return team;
}

var currentUser = "Beerus Dev";
var currentTeam = getTeam(currentUser);
 
4:28 PM
posted on December 01, 2021 by Bethany Nicolle Griggs

Notable Changes [c14eb2325d] - deps: upgrade npm to 8.1.2 (npm team) #40643 [a901b6c53c] - deps: update c-ares to 1.18.1 (Richard Lau) #40660 This release contains a c-ares update to fix a regression introduced in Node.js v16.6.2 resolving CNAME records containing underscores (#39780). [755c08573f] - doc: add VoltrexMaster to collaborators (voltrexmaster) #40566 [881dd7ba2a] - lib: fix regul

 
 
1 hour later…
5:43 PM
has anyone used CEF (chromium embeded framework)?
 
 
6 hours later…
11:15 PM
posted on December 01, 2021 by Ben Mason

Hi everyone! We've just released Chrome Beta 97 (97.0.4692.36) for Android: it's now available on Google Play. You can see a partial list of the changes in the Git log. For details on new features, check out the Chromium blog, and for details on web platform updates, check here. If you find a new issue, please let us know by filing a bug. Ben Mason Google Chrome

 

« first day (4064 days earlier)      last day (867 days later) »