« first day (3342 days earlier)      last day (1592 days later) » 

6:07 PM
hey guys I need help with babel
 
@MinaMichael 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.
 
hi bot
...anyway, has anyone used babel?
 
@MinaMichael What's your question?
 
I need to get the immediate child of a node
I can't seem to figure out how to do that.
are you familiar with babel js?
 
A bit in the past
 
6:08 PM
cool
documentation's not great
 
I need to get the immediate child of a node as in get the first child in a DOM Element?
 
sort of. yes
 
let parentElement = document.querySelector("#parentSelector");
let immediateChildNode = parentElement.children[0];
 
doesn't seem to work
parentelement.children[0]
 
console.log(parentElement);
Show me the output.
 
6:11 PM
I'm using the visitor pattern
the output would be large
 
Goto the Dev console
let parentElement = document.querySelector("#parentSelector");
Run that
 
1 message moved to Trash can
@MinaMichael Please don't post unformatted code - hit Ctrl+K before sending, use up-arrow to edit messages, and see the faq. 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
1 message moved to Trash can
 
bot trashes my message
 
Wait, thats not an HTML thing
It's not an HTML Dom Element right?
 
<ref *1> NodePath {
  parent: Node {
    type: 'File',
    start: 0,
    end: 123,
    loc: SourceLocation { start: [Position], end: [Position] },
    errors: [],
    program: Node {
      type: 'Program',
      start: 0,
      end: 123,
      loc: [SourceLocation],
      sourceType: 'module',
      interpreter: null,
      body: [Array],
      directives: [],
      leadingComments: undefined,
      innerComments: undefined,
      trailingComments: undefined
    },
    comments: [],
    leadingComments: undefined,
no
 
6:12 PM
That's what I asked bbefore.
 
it's not html
sry I didn't mean that
I thought you meant "like in html"?
 
What's this though
Never seen such a thing
 
babel
the js transpiler or compiler
 
I know
Is this like a config for that?
 
I don't understand
 
6:14 PM
Nevermind.
 
    let out2 = babel.transform(tc1, { plugins: [
    {
        visitor: {
            Program(path) {
                console.log(path);
that's the output of this
the "path" object
 
6:37 PM
@Vap0r my understanding is that Flux is the pattern that Redux implements. Flux is just a modification to the observer pattern. Redux is just a library that implements this pattern. Not sure where you're getting your conflicting ideas from, but I'm open to being proven wrong in this
 
@ndugger are you talking to me?
 
Is your username Vap0r?
 
oh sry hehe XD
have a good day
0
Q: Babel js. Get the first child of a node. Following the visitor pattern

Mina MichaelI need to get the first child of the "Program" node. I'm following the visitor pattern. let out2 = babel.transform(tc1, { plugins: [ { visitor: { Program(path) { console.log(path); // path.insertBefore(decorators[d]); } ...

 
6:50 PM
rendersubtree is smart, hilarious they didn't actually think of this for 5 years ._.
 
@ShrekOverflow why not display: none?
> The display:none CSS property causes content subtrees not to render. However, there is no mechanism for user-agent features to cause these subtrees to render.
yes there is
.class * { display: none }
what am i missing?
 
wat
> there is no mechanism for user-agent features to cause these subtrees to render
setting all children to display none does not render them
 
wait what, i read that wrong
but still, if you want it to render than don't put display: none. Don't really understand. Are they saying a tool where the parent element doesn't render but the children do?
 
You siad that there is a mechanism to cause the subtrees to render, then you gave some code that hides all children nodes... makes no sense, my guy
 
@ndugger Yes. I misread it.
 
6:58 PM
👌
 
But I don't understand what "there is no mechanism for user-agent features to cause these subtrees to render" means. Just remove teh display none.
 
7:25 PM
what is the best way to learn regex
 
Download learn_reg.exe onto a flash drive and stick it in your forehead
5
 
user10864482
@ChristianMatthew regexone.com
 
user10864482
@JBis matrix-style
 
7:50 PM
@Felipe Oliveira no problem, and the reason you need '[]' as a second parameter because that is the module or (main module), so you need to add that. Then when you create more, you won't need that because you declared it in the main module already
 
@JBis just remembered, this is a new feature: caniuse.com/#feat=css-display-contents -- it allows you to basically make it so the parent doesn't affect the render tree
 
lmao
i am using this regex and replace pattern
let regex = /^\s*(.*\S)\s*$/;

for (const blue of res) {
  console.log('output == ' + blue.replace(regex, '$1'));
}
the problem is it works well unless there is a linebreak in the middle of the sentence
then the end white space doesn't get cut off
so for a sentence like this \n\n that continues on the next like the regex fails
 
@ChristianMatthew heres a challenge: match all 4 digit numbers in a given string where the first digit isn't the same as the last digit
 
for the end removal of white space
not looking for a challenge
 
Ok. But it will help you learn.
 
8:06 PM
i need help with this one thing
 
8:22 PM
potentially interesting JS question stackoverflow.com/questions/59272642/…
 
8:36 PM
Hey does anyone know if theres something like typeof that will detect if something is a variable or not?
not detect the type of the variable, just if its a variable or not
 
err
that's... not the right way to think about it
tldr no, but you're probably asking the wrong question
You can't actually access the variable or property itself, what you're accessing is what it refers to, which can be referred to by multiple things of varying types at once
You could potentially do some ducktyping, like, if you have X, try to change it to see if it's a const... but i mean, at that point you're writing code for code that's been defined in the same code you're writing it in
kinda pointless
you can scroll up
 
 
1 hour later…
9:47 PM
Is there a good email client that's better than gmail?
 
define better
microsoft has one, hotmail, i prefer gmail
 
Client as in mail program (Outlook) or email service (gmail)
 
hotmail is riddled with ads, where as gmail isn't
 
I just miss inbox 😢
 
(I know Gmail has a client just clarifying)
 
9:54 PM
i haven't tried the windows 10 inbox
well, i did, but that was a long time ago and i dont remember what it did or looked like or why i decided to burn it with fire
 
user10864482
looking for an online javascript editor; like very basic
 
user10864482
I had one bookmarked but I lost it somehow
 
user10864482
thx
 
9:56 PM
They all have pros and cons
use glitch if you need client/server interaction
 
jsfiddle is the only good one
 
user10864482
in my case everything socket ish is blocked on policy level
 
10:23 PM
Codepen? @user400654
I find the gui more stable and enjoyable then jsfiddel
the little corner screen is too out of place
plus its got the same features
cdnjs search, pre-processors
etc
 
codepen sucks
 
:P
Explain
@user400654 In what way... Specifically... I mean besides the crappy pro thingy to unlock assets and projects
as far as Ive seen, codepen and JSfiddle have about the same features, but codepen having the better GUI
 
1: going to codepen.io doesn't start a new pen
instead they're trying to sell you on shit
2: auto-running my changes is irritating af
and i generally just don't like the ui
 
And? just go to the site codepen.io/pen
/pen isnt that hard for a measely programmer to type eh?
Or add to the bookmark page
XD
Also you can disable the autorun very easily
 
it's garbage
 
10:32 PM
and by default actually
 
i mean, if you have to disable it
it's not default
 
as for the gui, you can setup your own styling system if your going to whine about it that much :L
 
why would i do that when i have jsfiddle
 
no... I meant you can MAKE it disable it automatically in your account settings, not hard
 
my account?
so now i have to login?
 
10:33 PM
Id rather do that extra step for 5 seconds, and have a nice account with a visual dashboard of all my projects for all eternity
then have to visit a little 2x2 squared box every day
and search for my previous projects if you didnt save em
and have to look through a little screen on the bottom left
 
waste of time
 
heh... Your rep doesnt really make you seem like much of an experienced programmer, youve got the patience of a child, but the intelligence of a man? Am I wrong?
If your 100% deadset on JSFiddle, well, im assuming you just arent really giving codepen a chance
Its just much more beautiful and responsive in my opinion
plus those extra features i mentioned before
 
I'd simply rather code on real platforms, not silly website tools
 
WYSIWYG User calls out other WYSIWYG website for being a silly website tool Jolly Good Show!
 
well, no
jsfiddle is garbage too
i mean real websites. real applications. real tools
not toys in codepen
 
10:44 PM
Now your just being defensive, I think we all know that wed rather use a WYSIWYG then write our code manually and run an HTML file
 
I'd much rather write code in vscode and hit build
 
dos and donts in JS, suggestions please...
 
Your opinion bud ^_^ Id just rather save those extra 10 - 60 seconds building every change then have to wait it out
 
get a better build process?
 
@Mr.President Stay away from eval, Dont make tons of repeating variables or dont make variables with inclusive names, dont overwrite system methods and prototypes, and dont use deprecated tech
thats about the main things I know, but i still overwrite system methods and prototypes anyways because it makes it easier to write quick APIs
 
10:48 PM
@TaylorS Nice, thanks. Is there anything like PEP for Python, that covers a lot of JS?
 
Oh I guess you should also stay away from jqeury
should practically be a law in todays world
Honestly, ive never wrote python, so i wouldnt know
I teach myself programming, never took courses before :P
I should get into python at some point though
Artificial Intelligence desktop games sound fun to make, and apparently python makes that a bit more easier
 
Desktop games -C#/C++ (Nice games)
 
I write in C# and xaml forms for making desktop apps
I havent written any crazy games though
 
So, how would you make get/post request, if not using jquery?
 
Maybe one day, atm I've only written things like converters, formatters, downloaders... even made a crunchyroll downloader one day
I suggest looking into HTML forms for that, they should be able to retrieve and post data to server-sided languages by default
 
10:52 PM
fetch
 
we aren't your dogs you dirty formal programmer.
jesus christ I cant spell
 
dirty formal...? Directed at whom?
 
the "user" guy
 
for suggesting the "correct" way of performing an ajax request?
 
0
Q: How to use a numerical reference in neglected set?

JBisI am trying to create a Regex expression with a numerical reference (to a capture group) in a neglected set. Something like this: (["'])([^\1]*)(\1) Basically it matches all strings with either a single or double quote surrounding it. For example: "foo bar" "foobar" → "foo bar" and "foo bar...

 
11:24 PM
Learn has gained tremendous power:
> You can also add args by wrapping the arg number (starting with 1) in curly brackets. If you would like to escape spaces (like for a link) wrap the index in regular brackets.
|| learn hbd Happy Birthday {1}!
|| learn vampire_redirect google.com/search?q=[1]
wait
wtf
Did stackoverflow replace lmgtfy links ?
 
yes
they outright outlawed them
 
why and when? and why just in code?
 
because there's not a single case where you'd use them without being snarky
 
^^ that still works
 
they've been deemed "rude"
yeah, chat doesn't get updated
 
11:30 PM
:(
 
i wouldn't suggest having such a command on the bot
lest someone abuses it and gets the bot flagged
 
learn command or lmgtfy command?
 
lmgtfy
does the bot have a mindejail that RO's have access to?
 
hmmm ok. The android users added it. I'll talk to them.
@user400654 Yes
|| man ban
 
ban: "Bans a user" Examples: || ban @JBis , || ban JBis , || ban 7886229
 
11:35 PM
yeah i don't really care either way about lmgtfy, but... i've definitely moved such messages to trash before
 
However, bans are site wide. So if you ban someone in this room they are ban in all rooms with the bot.
ok thanks for heads up
 

« first day (3342 days earlier)      last day (1592 days later) »