« first day (3336 days earlier)      last day (1595 days later) » 

12:06 PM
For some reason, I wish you could write JS like CSS
would remove the need for overcomplicated selectors... and would remove large selection statements
#id {
 this.innerText = "foo bar";
 this.innerText.split(' ');
}
:P
or like...
#id function name(args) {
 // this statement represents the id you selected or other selector
}
 
write an extension/api for that
solved
 
would be fun
I already know how to create variable extensions, overwrite and add system variables and methods, and other tricks, so I bet I could do it
but making .classSelectors #idSelectors tagSelectors even[more="bullshitToMake"]
thatll be a pain in the ass, and I dont think its possible
if only I had enough skill to write my own interpreter... I have some lovely ideas for foundations
 
it is not difficult on first sight tho
 
nonono, I mean... making selectors without defining them into a string
 
interpret <selector> { <action> }
 
12:18 PM
so basically just writing naked selectors:
.selector {

}
without function declaring or other basic JS involved
 
then do const named = function() {<action>}; named.bind(document.querySelectorAll(<selector>))
but that does not work if you have a collection. So I need to adjust it
Array.from( that ).forEach(el -> named.bind(el))
ok
got it
|| afk lunch
 
@KarelG \o
 
lol
 
@JBis that's a weird response fyi ^
 
i wish it was lunch, sadly its only 7AM
still got 7 more hours of hell school
aww they dont have strikethrough
 
12:22 PM
hell
Dis not discord
 
two tildas is basic markdown ._.
 
ah I see
by the way, I was shortening a power statement for a program I made that uses Math.pow a LOT

and I created this little statement, but do consts not support multiple variables?
const pow=a,b=> Math.pow(a,b);
or does it not work like how a variable does?
 
Arrow functions need parenthesis for multiple arguments
 
oh I remember now, alright I try that
 
12:25 PM
const pow = (a, b) => Math.pow(a, b);
That should work
 
yeah thats what I did, alright I was just being sure.
so do arrow expressions basically work the same as any old function
besides the basic things Ive already heard, is there anything else unique about them
 
yup (with the difference that their this is the same this as their surrounding scope)
 
alright
Also, Karel, ive never seen an interpret operator anywhere before... was this a template or fake script or is it actually a javascript feature, I cant find any info on it
interpret <selector> { <action> }
you said that earlier
 
@KarelG it was supposed to be the waiving sign, but I'll change it.
 
@JBis KarelG is afk: lunch
 
12:35 PM
@TaylorS a ** b?
 
?
 
||> 10 ** 2
 
ES2018 introduced a double asterisk operator is what Madara wanted to tell you :P
 
@JBis 100 Logged: ``
 
oh
 
12:36 PM
Was it 2018?
 
cool.
 
Wow. I didn't know about that. Learn something new every day.
 
I forgot about that operator
.-.
wow it removes the need for a shortening function at all :P
 
is Math.pow a very efficient operation as far as cpu operations go?
honest question. I know multiplication is most costly than addition or subtraction
how does Math.pow stack up? Or is it implemented by repeated multiplications?
 
12:38 PM
Did you guys know that "-->" was an operator? apparently its like a fake operator that JS interprets as 2 seperate calculations, its like "a-- > b"
 
I wouldn't be surprised if there was optimization going on behind the curtain
 
I have no idea what it does besides the decrement operator "--"
 
So --> is not an operator but a decrement and a comparison :P
 
I'm sure there's a table lookup for smaller numbers
 
I guess so?
 
12:39 PM
||> 10-->5
 
@geisterfurz007Stopthischaos "SyntaxError: Invalid left-hand side expression in postfix operation" Logged: ``
 
I saw code with it and googled it to find that really only one page knew about it
 
Oh :c
||> let x = 10; x --> 5
 
@geisterfurz007Stopthischaos true Logged: ``
 
12:40 PM
||> let x = 5; x --> 5
 
@Neil false Logged: ``
 
what does it do?
 
Yeah, it's not a magical operator but poor programming style.
 
it is just "x--" > "5"
 
It's pretty much just a > b
With the side effect that a is decremented
 
12:40 PM
||> let x = 5; x --< 5
 
@JBis false Logged: ``
 
so.... (a-1) > (b)
 
its just a greater than operator .-.
 
@JBis false Logged: ``
 
12:41 PM
hmm.. wierd, thought itd be more interesting than that lol
 
a-- has the value of a but the side-effect that a is decremented after it's evaluated
 
@TaylorS a-- isn't a - 1
 
I had such a long discussion about that with chirag in the Java room xD
 
LOL
 
a decrement is -1 and increment is +1? Whatdnafuq?
 
12:42 PM
Yes.
Ok, thought experiment! Without running it in the console or something else, what is the result of the following
 
then @Neil wdym a-- isnt a-1;
 
let a = 20;
let v = a++ * a++ + a--;
console.log(v);
 
well a-- is basically a = a-1 or a-=1;
 
@TaylorS a--, --a, a++, ++a can't be called on a number value
 
20 * 20 + 20
 
12:43 PM
wrong
(at least not in Java, let me check)
 
because it happens ++ happens after the line
 
@JBis "ReferenceError: a is not defined" Logged: ``
 
Yeah, sorry about that :D
 
@JBis "ReferenceError: Cannot access 'v' before initialization" Logged: ``
 
Don't run it please. You can do it manually ;)
++ does not run after the line but after evaluating the expression
 
12:44 PM
20 * 21 + 22?
 
why
 
You have to know the value of a++ to multiply it with the other a++.
 
because the post increment or decrement means the effect happens after the value is returned
the right hand value of a++ and a-- is a
a changes afterwards
 
So the first a++ is evaluated in it's entirety which includes the increment after the value is "returned"
You can make things even worse:
 
12:46 PM
Ok so I was taught wrong in Java. I was told that ++ and -- happen after the line not after the variable was returned. Interesting.
 
though if I ever see something like a++ * a++ + a--, I'll find you and kill you in your sleep
 
let a = 20;
let v = a-- + a++ * a++;
console.log(v);
 
@JBis yep, it's like this in java as well
 
depends on the situation??
 
What's the result of that?
 
12:47 PM
it's an expression that actually changes the value of the left-hand variable
 
(and I have no clue why that is the result btw)
 
in C++, you could actually do v ++ 5
which meant increment by 5
if you passed no parameters, it would assume 1
not sure if that's true in javascript
 
I'm curious to try it though
 
in js its the same thing but 1 character is different:
 
12:48 PM
Makes sense to me.
 
v += 5;
 
||> let x = 0; x ++ 5;
 
@geisterfurz007Stopthischaos "SyntaxError: Unexpected number" Logged: ``
 
||> let x = 5; x ++ 5
 
@Neil "SyntaxError: Unexpected number" Logged: ``
 
12:48 PM
Oh :c
bahaha
 
ah doesn't work in javascript
 
I did always wonder why JS couldnt do increment by value
rather than the += operator
 
||> let a = 20;
let v = a-- + a++ * a++;
console.log(v);
 
@geisterfurz007Stopthischaos undefined Logged: 400
 
Riddle me that one please.
 
12:50 PM
its like it ignored the ++ and -- and just plain multiplied 20 by 20 :P
 
400 = 20 + 19 * 20
 
because 19 + 21 * 21 shouldnt do that
??
 
it didn't ignore it.. it's the same thing that happened earlier
 
12:51 PM
It's completely fucked because by intuition you would say that multiplication goes first
 
good god when did we turn our conversation into a chat about JS math.. Im already in math class, I shouldnt be killing MORE brain cells
 
You started!
(I think)
 
,____, Actually I think I did
 
Oh yeah! With your --> operator
 
a++ is the equivalent of:
let newA = a
a = a + 1
return newA
so by that logic, every time you call ++, you're modifying the original value
 
12:52 PM
brb, getting water
 
it isn't +1 or -1 with respect to the previous value.. that would be inaccurate
 
when I saw --> I really had hoped itd be an interesting operator to do something interesting... sadness sucks
Lol I guess whoever wrote it was either trying to make an arrow expression... or was just playing around
 
well now you've learned a new way to completely confuse the people reading your code!
 
Oops... Uh, I need to go do Study islands :L
Oh I could get confusing..
 
another fun thing to do is to replace the normal semicolon ; with the greek semicolon ;
 
12:54 PM
Im very good at doing bad practices
:D
LOL
 
why did I imagine that laugh as an evil scientist laugh?
 
I found a funny thing to do was to use unicode RTL symbols to flip the whole page around
visually
that always cracked me up
dont even get me started on backwards comments lol
 
.
.
b̧͖̺̦̪̫͉͋̍̈́͛͂̓̄̒̄̈͟ͅŏ̹̻̠̞̜̳̜̬̏͋̓̃̚͝͞ơ̫̫̪͈͈̝̬̎̀͒̋͜͟͝
.
.
 
euw
I remember when I was new to programming and I found out how to use zalgo
I put it everywhere like a maniac
I even zalgoed comments in my code and made my webpages anoyying asf
 
@JBis ah. That o/ is actually a "hi" wave. Not bye.
 
12:56 PM
oh you are evil
 
could be solved by only accepting ascii characters in variable names @_@
but no. UTF-8 must be supported. Think at those non-english people!
 
‮<div id="test">t</div>
this is the kind of thing I did
:>
theres an RTL at the beginning, making text like this: <div id="test">t</div> look backwards
 

« first day (3336 days earlier)      last day (1595 days later) »