« first day (3758 days earlier)      last day (1412 days later) » 

07:38
@paul23 remove all parameters. it's unfair that some functions/methods get more stuff than others. promote equality - make everything global! down with the rich hoarding all the values to themselves - distribute the data to the masses.
08:35
Hi can someone please help with this incorrect indentation issue fix posted here: stackoverflow.com/questions/65949447/…
09:13
disturbingly accurate
 
2 hours later…
10:49
const successor = (node: TreeNode): number => {
  node = node.right as TreeNode;
  while (node.left) {
    node = node.left;
  }
  return node.val;
};
how does the = (node: TreeNode): number => work here?
why do you need the (node: TreeNode):?
Hey, I have started learning Javascript a month ago. I have experience working with C++ and Flutter, but JS seems to be a tough cookie for me, what should I do to move ahead with JS?
@VaibhavKushwaha 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.
11:14
@Trajan In TS it's a good practice to annotate the values you use with the types they are. You can omit them but that will result in any being inferred which allows whatever value. Which, in turn, breaks the type safety and makes the usage of TypeScript questionable. With any you'd be able to call successor(false) or successor("not a node") as both are allowed.
There is even a compiler option that forbids missing the type annotation.
So, in short - you need the type annotation for type safety.
@VaibhavKushwaha I'm not sure what I can suggest. You can try books or videos or tutorials. Whatever helps you the most. There isn't The One Thing that unlocks the secrets of JavaScript. It's not much different to other languages - you need some tutoring and practice.
12:09
If I had to scale the difficulty of languages between 0 and 100 (100 is hardest)

JS: 35
C++: 60
The problem is that, youre used to CPP logic
And although Javascript is generally easier, you need to get used to the simpler logic
Its funny how it can be difficult to transition from Complex Logic to Simple Logic
I must also mention, you wont be able to understand a language in a month (unless youre just a fast learner and jump right in), so theres no point in worrying about it right now.

I jumped right into javascript and Ive been using it for around 3-4 years now
Im still running into basic issues and problems
mostly because I forget, but also because Im just plain inexperienced
12:41
Hey having an issue with a function, It is opening a URL, clicking a button in the new window (the button opens a new url on the same domain) and it is intended to keep clicking the button until the button no longer shows, but it only clicks the button on the first page.
document.getElementById("sharebtnalliance").onclick = function shareMission(){
    var mission = document.querySelectorAll('a[href*="/missions"]');
    var missionUrl = window.open(mission[0], "", "height: 80%; width: 80%;");

    for (var i = 0; i <= mission.length; i++) {
        missionUrl.setTimeout('document.getElementById("mission_next_mission_btn").click()', 1500);
    }
}
@SaucedApples Please don't post unformatted code - hit Ctrl+K before sending, use up-arrow to edit messages, and 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.
Thats because when you open a window, you have a reference to it in which you can write scripts to.

However, when it opens the URL, it immediately kills that reference
By open URL do you mean after the button has been clicked
When you click a url, even though it didnt actually open a window, its still counted as a new window instance
Ah I didn't know that
12:43
@SaucedApples Yup. After it goes to the new url in that window, your original reference disapears
poof
Is there a way around that?
I mean... This is extremely sketchy / malware based...

But you could use that window reference to inject a script that re-injects itself when a new window is opened.
I know I can reopen a window each time but there are hundreds or URL's and they spam at once
you can replace the url location prototype
and cause it to reinject the same script
and visit the new URL with a new window instance
like I said... this is something used by internet malware....
I'll try it - I had tried refreshing why didn't I think of that
12:45
But... its really your only choice
even if it is kinda sketchy
I'll try it now
@SaucedApples You just need to consider every time a new Document / Window instance is created
and implement a self-replicating function
that injects the same script
which... inevitably recreates itself
Essentially the definition of a Recursive Function
if I saw this used in production anywhere... id absolutely cringe
This is a personal project
Just... be careful with _BLANK targets.... you might accidentally open up 200 windows recursively every second
I had found it haha
12:48
:3
13:10
https://developer.mozilla.org/en-US/docs/Web/API/CSS_Painting_API

Excuse me what the hell is this?
CSS... PAINTING?
Man every time I stop looking at new web apis for a second.. some new crazy one pops up
"Part of CSS Houdini"
looks like Canvas as background image
I'm trying to decide if this is a good name, a bad name, or a name that's so bad it's good.
The name becomes so good when you say it and so bad when you don't say it.
https://developer.mozilla.org/en-US/docs/Web/API/Screen

And a screen API? I mustve just straight up missed this one...

It has some useful methods that define the exact pixel limits of the browser window
it subtracts things like the window border, taskbar
13:15
there's a bunch of api's for future to make desktop apps transition easier
you got me with the link.
@SagarV ???????
I thought it was some css thing. Realized it's JS screen only after opening the link
13:52
Hi everybody! Does any of you have strong understanding of webpack-dev-server? I'm generating multiple HTML files with it from the HtmlWebpackPlugin and I would like to access them in DEV from an url like http://localhost:3000/myPage.html. Is it possible?
 
1 hour later…
15:01
Just curious - without looking up, do you guys know what "firebug" is? I don't mean the insect.
I saw an older post that mentioned it and I wonder how relevant it even is.
15:20
@VLAZ I doubt its related to Google Firebase, so I couldnt know... However, I have heard of it
no idea what it is though
That's OK. Enough of an answer for me, I guess.
Point is: not relevant nowadays.
@VLAZ Oh, its an old firefox extension that is essentially chrome dev tools before firefox created it themselves
I do remember it now
I used it ages ago
before I became a chrome fanboy
:3
woah when did I get 699 rep
Im getting tons of upvotes today... interesting
I got a dead account thats question banned, and Im earning AVG 20 rep per day
wowzers
Yeah, I saw some question from a decade ago about "what's console.log" and it was tagged with FireBug
LOL
I remember the first time I discovered console.log
I was like... freaking out... like "OH MY GOD THE TEXT APPEARED IN THE DEV TOOLS! COOOOL"
I was easily impressed
Even though that was only about 4 years ago, it felt like its been a decade
15:37
console.log is the hero we deserve.
Shouldve seen my face when I saw that console.log can be styled with css
Why should have? You can print your face in the console and style it with CSS to show me right now!
@VLAZ . _ .
Ah, yes. Now I can sleep easy picturing this face.
Damnit... Now youve gone and got me motivated to make a Byte Array parser in canvas to rescale an image, sample the colors, and create ASCII colored art in the console
damnnnniiiit
now I really want to make it
even though I know itll be a pain in the ass
16:30
This maybe a really dumb question on react bootstrap. react-bootstrap.github.io/components/forms Why does the dropdown of react bootstrap look like bare html dropdown vs the one shown in bootstrap website which has a bit more style getbootstrap.com/docs/4.0/components/dropdowns
@user1692342 the first one is a select, not dropdown
Right, so I want to create a form in which I've a dropdown to choose from multiple options. Looks like for that I need to use select right?
You could also use a hidden input and fill it with your dropdown selection. But for starters it's probably easier to go with select.
I see, so by default there is no way to get it stylized like dropdowns?
16:46
As a user I prefer browser selects
17:38
hi
I want to pass a string and variable into component prop in Angular
Maybe I'm not understanding this, so entityName is my local var
      [text]="'No' entityName 'found' | translate"
I've quoted the strings and left var as is, so it will be evaluated. But compiler barfs
17:55
damn webpack optimizing things too much
guys good morning
need yours help
|| welcome itsme
@itsme 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.
 
2 hours later…
19:53
Hello
Can you help me how to include just two modules from whole bootstrap js folder without webpack ?
Webpack is sooo confusing
I just want to include carousel.js and collapse.js
And because I don't know how to setup the webpack.config.js I need to find an alternative way to do that
20:54
Can we use Bootstrap 5 in production ?

« first day (3758 days earlier)      last day (1412 days later) »