« first day (3433 days earlier)      last day (1737 days later) » 

06:15
Hi All
im using rest operator in one of my common response function. this response function is called whenever there is response made from the api to the client.
depending on my application scenarios different responses are send back, now im facing the scenario where there will be many arguments being passed back.
so im trying to use REST operator,

responseHandler.statusResponse(arg1, arg2, arg3, arg4, ...args)
but the problem is args gives me an array like below
args [0]
args [1]
args [2]
im trying to have it as an named args like
args ["userList"]
args ["countryList"]
is REST operator the right thing to achieve this?
@ZahidSaeed var e = document.CreateElement( 'button' ); e.textContent = "Close"; e.onClick = close; e.addEventListener( 'hover', evt => evt.target.textContent = "Now" );
06:34
@SamSam Rest parameter only give you array. You need to pass an actual object to get what you want.
@Sheepy yes im passing the actual object
args[0]
     -- [0][1]
args[1]
     -- [0][1]
whereas what i want is
args["myFirstArray"]
args["mySecondArray"]
@SamSam You may use object destructuring to parse the param quickly, but the param itself must be an object, not an array, and not rest params.
ohk, got it @Sheepy thanks alot.
You are welcome.
@ZahidSaeed You use closure to keep references to all your own elements private, allowing to to refer to them without using id, thus avoiding conflicts.
Hello. Any pegjs gurus here?...I am trying to fail a grammar rule but getting unexpected results...will share code upon request...
07:45
Hi guys!
@OblicionA 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.
I have a small challenge that any expert can solve it, just me blocking in my mind
this is my code:
@OblicionA 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.
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
i need one suggestion
07:47
my client application is in angular and backend is in node.
Im looking to integrate a testing framework for which i have gone over
Jasmine, Mocha and Jest
export function editSerier(data, artikla, products) {
    return (dispatch) => {

        const filteredProduct = Object.assign(
            ...Object.keys(products)
                .filter(key => products[key].Artikelgrupp === data.Artikelgrupp)
                .map(k => ({
                    [k]: products[k]
                }))
        )

        // Beskrivning: data.Beskrivning,
        // kategori: data.kategori,
        // status: data.status,
        // synas: data.synas,
        // tillverkare: data.tillverkare,
can anyone suggest which would be a better option to go with?
Jest @SamSam
@OblicionA thanks, any specific major advantage of going for it?
from all the three it is the one that has more support around the dev community
07:50
dev support shouldn't be an (or the only) indication
it has nice documentation tho
jasmine is also a valid alternative (has better integration in angular AFAIK)
ok, i will research more on JEST and Jasmine
what i see is MOCHA Chai is not an alternate when it comes to JEST and JASMINE?
Chai is an assertion based one, no?
kinda vague
/searches
but so is Jasmine, more of a assertion based.
08:31
guys anyone wanna earn a 1$?
I want to earn a bit more. is that an option?
09:22
@OblicionA thing is ... you did not ask your question. There is only a block of code
@OblicionA a whole dollar bill! Gosh golly, that's a lot of money
it is in RDR2 !
09:41
true
it's overwhelming at start ._.
still trying to figure out things
tried to shot a 3 star ram with a varmin riffle.
<.<
10:05
hey guys - whats your recomendation on getting commercial experience with node when you come from predominantly another stack (e.g. .NET)
10:26
Hi all
10:38
asl
@akhilesh 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.
is this like yahoo msngr? hehe
reminds me to good ol time
fck java - yayyy js
it's more like an irc channel
cool - tmrw is punch a java dev day
make sure to contribute wholeheartedly - throw in a few punches - haev a great day b4 corona virus gets u
can u spk pprly pls
10:45
this is how it goes here pal
i can allow u to punch a C, C++ or C# dev too -thats it not anymore
Yeah, it's definitely not
random person telling Ben how things are done in JS room
As no, this is not like Yahoo messenger
10:47
@akhilesh no. Please have a proper chat etiquette. and don't use "u" anymore. That comes over as annoying.
@KarelG back in the day people ignored if it annoyed them - now they act like pussies on internet
@BenFortune did you survive the Taylor drama yesterday. Got recovered completely?
@akhilesh You can ignore people on here, but if you're going to act like an ass you can leave.
@akhilesh not sure which back in the day you're talking about, but most of us are not 12 anymore
lets all keep calm n listen to some gojira
except for @KarelG who thinks between corona virus and the alphabet 'u' - latter in annoying
do u even console.log bruh?
10:52
come on, man
🙄
i do console.log like twice daily - an additional if i feel tough
if you're just gonna troll, might as well leave
you have to use it someday if you want to debug your javascript code.
@KarelG is "smoll" allowed?
10:53
debugger; is nice as well but it breaks the flow
@Wietlol like smoll bunnies? 😀
more like smoll doggos
how does one carry on - realising - we are jst part of something bigger we cant comprehend - for example an amoeba - cant in its lifetime perceive what things like bucket, mobiles, bridges, pillows etc are. so high chance we cant comprehend similar things
jst got a pop from harvard school of philosophy - u want a scholarship bruh?
I guess you cant comprehend Java either...
hence the hatred
hey man - its the language of beings above me - cant complain
Tay
Tay
@akhilesh Ill take that scholarship, although, my gpa isnt 4.5, its like 4.2 or something, so I probably wouldnt get in
and yes ik you were joking
11:08
bruh if we are flexing our gpa? dont even get started - u r talking to an indian :P
Tay
Tay
Curious, my current drawing board canvas just places tons of Arcs in line with the cursor position relative of the canvas and the actual page.

Is this the best way to go about this?

i was going to try making some kind of "lineTo" version so if you move your mouse too fast, itll just draw lines between the points, like what most programs do.
@akhilesh you are*, well actually you're*
switching to HR, brb
@akhilesh Told you before, stop being rude and annoying.
@KarelG
yes?
11:12
its all about love and peace man
true, but I only asked to not use "u". There are other grammar errors you have made. I did not even mention these. It is just that use of "u".
hahahahahaha u are doing it again my fren, this too shall pass
Tay
Tay
Its not hard to type you instead of u
@KarelG "There are other grammar errors you have made." is that an invitation?
Tay
Tay
Like infact, itll increase your cognitive motor functions :P
11:14
Taylor, don't participate in that
he's just trolling atm
get over with it
Tay
Tay
Makes sense, alright.
;3
[1,2,3].map(i=><h1 key={Math.random()}> {i} </h1> ),,,, [1,2,3].map(i=><h1 key={i}> {i} </h1> ) // what is two different between this key method if I use Math.random() .... reactjs
@NIKHILCHANDRAROY not sure, but I assume making it "unique"
re-renders on the page are only done when the elements change
giving it a silly key=something-unique would enforce it most of the time
Tay
Tay
Ok... I know I usually dont pipe up about people often, but Akhilesh is getting a little past inappropriately disgustingly rude.
but that is just my guess
11:19
3 messages moved to Trash can
Tay
Tay
Wow thats a cool effect.
You can rotate off a given axis, and create lines to it based off mouse position, its a nice looking effect
Not what I was looking for, but still cool
oh god.
@Wietlol Is there any way to make the Math.random() that will not match any number? for example , if I use Math.random() * 10 it will match any time accidentaly
not match any number?
don't use Math.random() if you don't want to get a number maybe?
if you want to make a safer approach to do unique values, you could use uuids or a round robin int generator
11:27
||mdn getrandomvalues
round robin int generator?
Tay
Tay
Ok, I got the perfect drawing effect, exactly what I was looking for. EXCEPT... every time I click, it goes off the latest positon.

How can I make it go after the latest mouse Click position every time a new line is made. https://jsfiddle.net/SirCode/6jsc0f2h/28/
Like the effect is amazingly perfect now, but it still goes off the default point, so it creates perfect lines to the last position
ok..
um... Nevermind it worked
@Tay yeah, seems fine to me
Tay
Tay
yeah I fixed it, it doesnt create lines in between now
I just had to set curLine to the mouse position BEFORE I drew moveTo();
facepalm
Oh, by the way, say I have a function that requires a Color attribute, and I need to use an Argument for it, but the function is a function reference
since function references use explicit arguments, how do I send in that second argument along with the event that I need
so that im returned the Event and the Color
Guess Im going back to variables, I did notice this one though: stackoverflow.com/questions/256754/…
Gotta fucking love jsfiddle, look at this crap:
11:46
That's not jsfiddle's fault
Tay
Tay
Well, technically that fiddle was working locally
JSFiddle has display: hidden elements in the page
No, your issue is closures
And this context
Tay
Tay
Oh the canvas, yeah I removed that, I thought itd do something other than what I expected
this object is wierd, its hard to understand its origin sometimes, but usually it works pretty well
It's still there in your last link
Tay
Tay
Ben your viewing an old link
thats why I dont like jsfiddle
ya have to set as base and save to different urls
it just doesnt make sense
11:50
You literally pasted a link then told me I'm viewing an old link
Don't paste an old link
Tay
Tay
Ive saved changes within the time of posting the link, sorry
back from lunch
@Tay fyi there is a version id at the end of a fiddle url. use it
at least you are showing process with your variables
Tay
Tay
i know.
I dislike it, I use github for version control
I dont care about vc in jsfiddle
Did the troll leave or get booted?
Booted twice
12:02
Wow
*shrug*
Never understood that mentality. The same pleasure we gain to see someone be happy they get from the opposite
Tay
Tay
Hes still here. but lurking
:P
No worries
Tay
Tay
Hmm, hows this idea sound:

I want to make a shape drawing system for the canvas. Best Idea I could come up with, is a second invisible canvas that clears and draws as you click and hover.

It will create the square shape in the second canvas, and once you mouseup, itll actually create it in the normal canvas.
12:06
Why would you need a 2nd canvas?
Tay
Tay
Because the first canvas cant be cleared
because it has content in it
Well there's your problem
Canvas drawing libraries keep track of what's drawn on the canvas
So you have an array of existing elements, and (a reference to) an element you're currently dragging / editing
having two canvasses running on a single document is hard to maintain and keep separated ...
^
It just adds unnecessary complexity
Tay
Tay
@Cerbrus if I stored that many variables, like all the locations of the lines and everything, I think itd be a bit tough on performance
12:13
You think wrong
Tay
Tay
@KarelG the 2nd one will be the only one running, and its the only one that will have an animation frame running
the bottom one is static, and wont even be editable while in the 2nd canvas
Ive used that method before for similar "hacky methods" and its worked pretty well
Web browsers / canvas nowadays is powerful enough to run a 3D game like Quake
Don't worry about performance drawing a couple of simple shapes
Tay
Tay
Not every canvas
Im running this on a five dollar school pc
Three.JS doesnt really even work here
now my home pc, I could probably run 20-30 three.js canvases at once
Didn't I tell you I don't want to hear you complain about school hardware?
We're not going to give you answers tailored to the shitty hardware you choose to work with.
Tay
Tay
again I didnt choose this...
But besides the point
12:18
You choose to do extracurricular programming on it.
Tay
Tay
¯_(ツ)_/
:L
Cant even make a shrug lol
¯\_(ツ)_/¯
Hello all!!
@NikhilGupta 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 nikhil
I new to JavaScript. Any good link/tutorial to understand Promises in JS ?
I am*
Tay
Tay
12:23
|| mdn Promise
@Tay Command with that shortcut already exists
Tay
Tay
|| shrug
¯\_(ツ)_/¯
Tay
Tay
12:24
lol
wish deleting a message could send it to the trash
Only ROs can do that though, Gotta love SO features :I
why should it send it to the trash?
@Tay why? Deleting is not the same as moving
Tay
Tay
deleting the message keeps the message, it just hides it with (removed)
not exactly a delete
10k+ users can still read it :P
@Tay which is a good thing
12:30
@Tay It's a soft-delete
Which still is not the same as a move
Tay
Tay
Well, in any sense
its all personal preference
no ones really going to truly think the same way
@KarelG is it 10k or ROs?
can't read it myself
oooh.
discovered something.
I beg pardon. I can read it yes.
ROs definitely can, not sure about 10k+
Tay
Tay
10k rep just to read a hidden message that can be read by anyone via history button?
or are yall talkin about something else
12:36
@Tay Not everyone can read those messages
Only the owner and ROs
@Tay: I'm pretty sure the "history" button disappears if you reload the chat
iirc
yeah not everyone sees the history button
@Cerbrus just reloaded the page and it's still there
😕
because you're a room owner
room owners can see the history button, everyone else but the author of the deleted message cant
Iirc, it also had something to do with being in the room when the message is posted
12:44
once it goes off page into the transcript, it's gone
Tay
Tay
12:56
Im not an RO, history button still there
shows history
on your own message...
When logged out, the button isn't there.
Tay
Tay
oh...
im dumb
@Tay try reading that
Tay
Tay
yeah its not there
12:59
there you go
user12960916
13:15
Hi
Hi guys
@Apeiron 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.
hello
hello
I am trying to make a chat but when I hit the input field the box not set any scroll but I set the scroll, please see codepen.io/nikhilroy2/pen/LYVeMxz
user12960916
Has anyone used any Javascript framework such as React, Angular Aurelia or any other one?
13:34
@csscoder There are multiple users in here that used several of those.
@csscoder share your question here
user12960916
I'm trying to make a note taking webpage where a student can upload audio/video on one side of the page and take notes on the other side, when they take a note the timestamp will be recorded if they would like to see the specific time the topic was talked about but I am not sure if all frameworks can make a page that does all of these things. I've only started learning javascript and now I need to pick a framework but I'm not sure which would be best to start with.
user12960916
I don't have any code to share since I'm still deciding on the framework, does anyone have suggestions for which would be easier to start with?
user12960916
It's for a project so it's not optional I need to use a framework
user12960916
I've looked up some frameworks but I'm still not sure which would be best to use
user12960916
13:38
I'm thinking React would be best but I'm not sure
Morning o/
user12960916
morning
What do you want the framework to do?
What kind of experience do you have?
@csscoder people here love react. Personally, for that project, I don't think you need a framework.
user12960916
Beginner, I just started learning Javascript
13:40
Speak for yerself! I don't like react. :D
Trust me, I don't like it either.
Then a framework like react or angular might be a bit "deep end"
user12960916
But we need to teach ourselves so I wasn't sure which would be the best for a beginner if I haven't used a framework before
user12960916
Oh ok
user12960916
I saw Blazor and Aurelia as well but not sure how those work still need to look into them more
13:41
I don't know Angular, React, or Vue. But angular seems the easiest to me.
i should really learn react
user12960916
I saw Angular a lot whenever I searched which is the most popular one, is that the one people usually start with?
@csscoder Don't bother with Blazor yet
React seems to be extremely popular.
It's not matured
hashnode.com/post/… take a look at the answer by Jason Knight
Learn proper JS first
Honestly, diving headfirst into a large project like that might be a little too much, imo. Mess around with small problems, first.
meh, understanding state management (cause you basically can't do anything in react without redux) is a complicated topic with a semi-steep learning curve
user12960916
13:46
I read his answer and although I agree that you should start small, I don't have an option I need to pick one it's for a class otherwise I wouldn't use anything either
user12960916
I think I'll use Angular
use html/css/js
realise we need stuff to actually be able to do it
use jquery
realise we need to do things better than that
use react
realise we should just do html/css/js
realise we need stuff to actually be able to do it
use jquery
realise we need to do things better than that
use react
realise we should just do html/css/js
realise we need stuff to actually be able to do it
use jquery
realise we need to do things better than that
use react
realise we should just do html/css/js
realise we need stuff to actually be able to do it
Tay
Tay
Oh god...
huh?
Tay
Tay
What the living hell?
13:50
react is the ui framework we didnt deserve, but the one we needed tho
not sure how react works in js is something tho
I only use it in a sane environment
I feel like the tech swapping is a js thing
it is something that always happens in the js field and pretty rarely anywhere else
Tay
Tay
Ugh.... I have to present my cringey home made video to class
sigh
@Wietlol they should make a js library swapping library
so that it can facilitate swapping js libraries easier
@Tay these were/are my favorite type of assignments
Tay
Tay
I prerecorded everything, so its not me presenting, but its still cirngey
I have to make the whole class listen to it
cringeeeeee
@Wietlol lol, do you even do web dev?
Tay
Tay
13:53
I sound like a girl on mic
@Neil I actually see a business in it
@JBis sure
@Wietlol except you wouldn't use it in the first place because you didn't think you'd swap js libraries
@Wietlol lol. I meant cause like you seem to do mostly C# and stuff.
so now you have to adapt your code so that you can swap a library
ye, it must be a morning after fix
it is a business, but a difficult one
@JBis well, I mostly do Kotlin stuff
C# stuff is just a bonus
but no one talks about kotlin because it is super easy
13:55
Kotlin seems like a great lang
no one really has any issue with it, so no one asks questions
I've never heard any complaints
see?
:D
it is just an extra layer of language
I like it
13:56
might make people stupid because many features are abstracted away IMO
I started using it, just haven't found a need cause I do mostly web dev stuff with node on the backend.
do you need to be smart to make a crud application tho?
^ No, 'cause I've built one ;)
@JBis it depends if you don't have to work on "legacy" software. Like my CRM, still in java EE with jsp scriptlets we're slowly converting to jakartaEE
just encountered a script block in a jsp page with == for equality check
the question is ... would turning it into ===break it. (might be)
I'd call that "old fashioned"
13:59
my ide is freaking out
If you can test it w/ === then change it

« first day (3433 days earlier)      last day (1737 days later) »