« first day (2897 days earlier)      last day (2056 days later) » 

12:07 AM
forrest i believe in u man
also maybe u can also be a therapist and analyst like tobias
 
it could work
 
12:32 AM
Interview tomorrow, send good jimmies for me friends
 
@Egrodo 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.
 
user8871181
I am just getting my head around arrow functions and map() and would like to confirm my understanding:

const map1 = array1.map(x => x * 2);

Does this mean it produces a new array by taking array1[] and executing "x => x * 2" on every array1 value/index?

..if that makes sense ;)
 
yep, sounds correct
 
user8871181
:D finally grasped the idea - @DavidKamer you lowered the rope into my reach!
 
the first parameter is the item in the array and the second optional parameter is the iteration
lol, you figured it out. You should be proud of yourself!
 
user8871181
12:37 AM
@DavidKamer With the help of the JS experts :D (you guys)
 
@demonhunter24 I'm sure a lot o people who are regulars here would disagree that I'm an expert lol
 
user8871181
@DavidKamer Maybe thats true.. but you are experienced and know the ins and outs of JS
 
JavaScript is so much better than many languages that are "superior". They'll all learn how awesome JS is in the end I hope!
 
user8871181
Is JavaScript the only language that hoists variables?
 
So I am trying to switch back from Dvorak to Qwerty
I really miss the one handed keyboard shortcuts that are available with the right hand on Dvorak
ntcrwlv are all on the right hand in Dovrak
it makes windows navigation on my laptop really easy
 
1:00 AM
@William why did you switch in first place?
 
1:16 AM
@JBis I was thirteen wanted to try something new basicallly
I have been on Dvorak for quite literally years
Currently the best bet I think it to make a Qwerty layout with Dvorak keyboard shorcutrs
 
@William Wow.
 
shit dude most people in their teens who want to try something new turn to underage drinking or listening to edgy music... what kind of 13 year old switches to dvorak?
 
I have no idea what I was thinkinhg
When I saw it was preinstalled on every computer I basically decided
 
Dvorak is probably a better layout from what I read but it would be difficult to transition now that I am so trained
 
Ubuntu, Windows, Mac, ChromeOS, iPads all have it preinstalled
I think I am going to make a Microsoft Keyboard Layout Creator version with Qwerty keys but dovrak shortcuts
now
and see how that goes
 
1:21 AM
good luck
 
the only reason I am contemplating switching back is because
 
@William Can you send a pick of Dvorak? I looked up but found many different layouts
 
my dvorak is different
I mean the preinstalled one on your computer is really really close
to what I type on
 
 
this is basically it
 
user8871181
1:24 AM
gross
 
Ah
 
except I moved all the symbols back to there default locations
if possible
 
Well the best keyboard for speed is stenographer but who tf knows that?
 
I left z in the default location
 
 
1:25 AM
I actually messed with ubuntu stenographer software for a bit
basically if I can't take my ideal setup around o laptop
I am not going to use it enough to learn it
 
ew
 
I basically concluded it can be done but I don't recommend it
Dvorak positioning of the dash key makes a lot more sense as a programmer
especially terminal commands
 
lol
I don't have memory for tha
can't even type correctly with qwerty XD
 
Dvorak could have been really really good
if they repositioned a couple more keys
like honestly there are only like four keyboard shorcuts people use on a regular basis
and they all could have been in their default location
I actually type on a JIS keyboard layout now which is why I am thinking of switching back to Qwerty
control+r and what else?
and save
 
@William C V X Z
S
 
1:33 AM
yes
which could have appeared in there default locations
with out decreasing speed except for c
I would argue if they could go back in time
put z in its default locatoin
because it is only being used by ; right now
 
Workflow: W Q (macOS) T P
Text: B U I
 
true but in my experience those aren't used nearly as much
 
Selection: A Alt/Option Shift
 
plus ctrl+p can't be down with one hand
well sort of
 
I think thats it
 
1:35 AM
@JBis are you using a mac or windows computer now?
well or I guess linux
 
@William Mac
 
yeah mac actually has a dvorak with qwerty keyboard shorcuts layout it
I used it in the beginning
I hate where macs modifiers are on its laptops
 
I can't switch though. I use it to type notes. I would die.
 
on the desktop its barable
I want to get a JIS macbook pro
 
If I was actually dedicated I could probably get it so I wouldn't have to look in a day.
 
1:37 AM
oone of these days
 
@William JIS?
I would say in a week I would be able to type slow but able to type.
 
1
Q: When did Apple adopt the JIS keyboard layout as it is now for their MacBook Pros?

WilliamWhen was the current JIS (Japanese Industrial Standard) keyboard layout adopted on Macbook Pro's? The JIS keyboard layout keeps the Roman letters in the English QWERTY layout, with numbers above them: This is the JIS layout on a Thinkpad:

 
A year I would probably be up to normal speed.
 
@JBis its weird because I learned Dvorak with out stickers
 
@William Thats sad. I commented on that XD
 
1:38 AM
when I look at qwerty I think/see the Dvorak key
My question was originally a nitpack of why did apple do such and such
didn't go well that way lol
@JBis anyways I need to go in a minute but essentially the layout is nice if you assign the control/command modifier down there
where the modifiers are on either side of the space bar
then you can actually hit the modifiers comfortably with your thumb
 
I am on Davorak
 
right now or in general you always are?
 
wait
 
the only 2 keys the same in Dvorak and Qwerty are a & m
 
jst switched
this sad
 
1:44 AM
great just stick at it and you'll want to switch back years later like I am now lol
if you aren't usiing a mouse regularly it works fairly well
 
lol
 
user8871181
@William what have you done?! rip @JBis
 
@demonhunter24 haha
I'm back to querty
 
let me type in Dvorak on Qwerty
pdk md ktrd fl H.soava sl X,dokt
its like a foreign lanuage
9
Q: Dvorak layout with Qwerty hotkeys (Dvorak — Qwerty Ctrl)

ZazHow can I use Qwerty hotkeys with the Dvorak keyboard layout? For example I want C to map to J, but Ctrl + C to remain as Ctrl + C. The dvorak-qwerty program is supposed to do this, but does not work for me. Desired behaviour seems to occur in the terminal and with foreign language layouts.

I learned pure Dvorak eventually because of this bug
or feature depending how you look at it
 
davorak: getting better
 
user8871181
1:49 AM
@William This is yours then isn't it?
http://wbic16.xedoloh.com/dvorak.html
 
my biggest pet peeve with Dvorak is the location of the U and I keys the should have been swapped
 
like ";" location
 
No it isn't just name coincidence
 
Ok
lets test
race
@William U on Dvorak me on querty
k?
 
maybe lol
I am trying to switch back to qwerty remember
I am actually using Qwerty
 
1:52 AM
switch back to Dvorak just for this
make it your departing challange
:)
XD
 
I'm sorry but I think it is a really bad idea honestly
 
And no programming a bot to type it for you (I did that once just to fuck with friends)
@William alright
 
just this once
I figure if nothing else it will make me wish
honstely I just prefer the keyborad shorcut locations on dvorak
mainly
 
yay!
 
I doubt I am much faster
 
1:54 AM
You can do it a couple times just try to get your best
 
how does the site work
honest question
 
You type as fast as you can the words you see. They are not hard words, usually pretty common. Do it as fast as you can for a min.
You get an accuracy rating and a speed rating
Both are important
 
so this is a honesty word of mouth thing you are curious about?
 
try it out see if you get it
 
because honestly I thought we would be racing against each other at minimum
that would be a lot more fun for me
 
1:56 AM
@William I guess. I just want to know the the keyboard is actually faster than qwerty (not really good experiment since were two diff people but idc)
 
yeah no thansk
@JBis it isn't faster really its more comfortable
based on studies
 
but we could race against each other :)
if you think you can beet me.....XD
 
yeah I'm okay thanks though
 
ok
lol
 
user8871181
@JBis your on
 
1:57 AM
uh oh
 
user8871181
?? I am not that fast
 
user8871181
but fairly decent
 
nm, I thought you switched to Dvorak and mistyped
lol
@demonhunter24 Sure. Lets do it.
You get how it works?
 
user8871181
@JBis ok I got the hang of it..
 
@demonhunter24 great! Lets the races begin! Do it a couple times get your best :)
 
user8871181
2:00 AM
ok
 
user8871181
@JBis what did you get?
 
61 WPM 91% Accuracy
And you?
 
user8871181
57
WORDS / MIN
252
CHARS / MIN
98
 
user8871181
..copy and pasted
 
 
user8871181
2:10 AM
You are faster but I am more accurate
 
I got that once. Most I got 56-59
@demonhunter24 Yes.
 
user8871181
xd
 
gg
 
user8871181
gg

blame it on lag lol
 
I think my best ever was 65. But been around 55-65 for a while now. Can't get over hump.
My bot got VERY high XD
 
user8871181
2:12 AM
? How did you set a bot? Just modify some JS?
 
Do you have Mac or pc
 
user8871181
both
 
Yes. JS and then AppleScript to enter keys.
I'll show you:
gimme sec..
 
user8871181
oh.. wouldn't it be easier to just save a local copy of the page and then write in some extra JavaScript code?
 
I realize using Qwerty I get really lazy
sad but seems to be trueish.
 
2:16 AM
@demonhunter24 I wasn't 100% sure how to do enter keys in JS so I figured this would be quicker than looking up
tell application "Safari"
	repeat 10 times
		activate
		set a to do JavaScript "document.getElementsByClassName(\"test-word undefined\")[0].innerHTML" in current tab of first window
		tell application "System Events"
			keystroke a & " "
		end tell
		delay 0.1
	end repeat
end tell
Adjust delay to speed you need
and repeat to number of words
 
user8871181
@JBis wow. But why would you even?
 
FUCK
don't click off webpage or your computer will go to shit
 
user8871181
ooO nice!
 
It just kept typing in a document
so I hit command and it just opened a bunch progams
 
mac really does have srcipting built in which is much nicer then Windows
I'll give mac that
their modifier situation is borderline horrid though
 
2:26 AM
lol I ran my bot and it finished before the timer
 
user8871181
Theres a finish?? Thought it was randomly generated words!
 
@demonhunter24 Yes, me too originally. Idk why its not.
 
I am installing my new Qwerty Keyboard laout
 
@William yay
:)
Alright I'm gonna go
 
user8871181
:(
 
2:32 AM
Thanks for a fun game @demonhunter24! And thanks(ish) for teaching me about the Dvorak Keyboard @William XD
Cya ppl tom
Adios
 
@JBis no problem really funny issue
 
user8871181
@JBis See you tomorrow (adios)
 
if I press alt then a key a different shorcut occurs then
if I press alt+key at the same time
 
2:44 AM
@William Are you on windows?
 
3:02 AM
@DavidKamer yes
why?
 
@William That's the second reason I quite using Windows as my daily driver lol. Key combinations will do different things based on what order they're pressed... And it isn't filtered well
 
@DavidKamer no this is a different issue although you aren't wrong
 
@William yeah my first reason was settings changing back with no warning...
 
so what mac?
because ubuntu and debian work the same as windows generally
 
@William not in my experience. I use ubuntu. The delay or something is different... I think it's all based on key up
 
3:07 AM
Ubuntu menus work the same way
 
windows company representative watching this starts project to change all events to key up
@William what do you mean? I thought we were talking about shortcut keys
 
go to ubuntu terminal
it should display a menu bar at the top
like File Edit Help
press alt
will let you select from those menu items
 
this is true if I hold alt
 
yes but on windows and ubuntu alt f and alt + f can do different things
well I though ubuntu was the same way but could be wrong
 
honestly it's not working for me
 
3:10 AM
shrug
I don't use Ubuntu as my primary OS for a while
mainly the App gap mostly
 
@William huh, the first letters are highlighted but when I press f or F it just prints random chars to the screen lol. Most apps are available unless you need something like Adobe. I just run a vm if I need adobe though.
Most are available via snaps now and/or on electron
 
VM suck
 
You can use your native GPU on a windows vm in ubuntu/linux now
 
running adobe software through vritual machine sucks
 
well only Nvidia I think
 
3:17 AM
I mean seriously
video editting with adobe with a VM?
nope
 
@William Depends entirely on your setup imo. A great computer can completely make up for that and real editors probably run their video editing software on VM's on servers
 
you haven't down this then
adobe already sucks
 
I just do 8 gbs ram and 4 cors with my 1080 pached through to the vm
 
why do people use FCP10?
I gaurantee it isn't going to be faster
spotify? You really want to run that through a virtual machine?
I guess you could
I have had more errors with virtual machines then anything else
 
@William No I have snap installed locally
snap lol
I mean Spotify as a snap
 
3:22 AM
I willing to bet it has features missing
I used their spotify apps years ago and it was half baked
 
@William windows idles at 30% cpu half the time for no reason on windows... It's an i7 8 core!
 
heck their android app is half baked compared to the iPhone
 
@William a few years in Linux time is a long time
Linux is the most used system in the world
 
there is to much of an app gap for me though unfortunately
 
@William what apps?
 
3:24 AM
linux is the most used server system in the world
android isn't really linux
 
@William and the most used mobile
It is lol
 
not really just barely
 
and Java isn't really a language but here we are lol
 
they took so much of linux out I wouldn't call it that
I mean system calls wont work
nothing that makes it linux wil work even on a rooted phone
 
@William @William I think this is something people say because other people say it
 
3:25 AM
Java has always been a langauge
 
@William use arch linux and then you will understand what I mean when I say linux lol, I'm not saying "Linux is Debian"
@William I mean technically it's a virtual machine pseudocode but you can use it like a language.
But seriously though, what apps do you think you can't get on Linux?
 
Can you get WSL to run on Linux?
 
user8871181
3:52 AM
Can someone give an example scenario where a callback function might be used?
 
I'm not sure if i can talk about it in this room, but it's about js a little ig. There's any difference between microdata vs JSON-LD (talking about SEO)? from schema.org
 
@littlepootis lol, you get the real thing
@demonhunter24 look at Array.prototype.map on mdn
or like how you used reduce
 
4:28 AM
I don't want the real thing.
 
user8871181
:(
I am confused again...
 
@littlepootis lol
 
user8871181
var fruits = ['Apple', 'Banana'];
fruits.forEach((item, index, array) => console.log(item, index));
 
user8871181
Output:
Apple 0
Banana 1
 
user8871181
..How is the index parem filled with the correct index value?
 
4:35 AM
How not lol?
 
ahaha what do you mean how?
 
@demonhunter24 because the array is indexed
 
user8871181
Becuase its just a placeholder isnt it?
 
o_O
 
each member has an index to access it
 
user8871181
4:36 AM
yes I know that
 
placeholder?
 
user8871181
yes like....
 
user8871181
function myTest(myArg) {
    // do something with myArg
}
 
user8871181
..myArg doesnt have any value here until we call the function and give it value..

myTest("Hello");
 
oh i see, you're confused because you're not sure how your function is being called
forEach calls it internally
 
user8871181
4:39 AM
ahhh ok
 
this might help
i have written my own forEach that does something very similar to what the built in one does
const myForEach = (arr, fn) => {
  for (let i = 0; i < arr.length; i++) {
    fn(arr[i], i, arr);
  }
}

myForEach(['apple', 'pear', 'tomato'], (item, index, array) => console.log(item, index));
try run that and play around with it
i'm not calling the built in forEach anywhere
(i've renamed the forEach to myForEach to make it more clear)
 
user8871181
*lightbulb begins to glow
 
yeah but it doesn't actually do this unless you do a pollyfill
The system optimizes it
that's the idea of functional programming
 
user8871181
5:03 AM
I've got the following code...
 
user8871181
var fruits = ['Apple', 'Banana', 'Orange'];
fruits.forEach((parem1, parem2) => console.log(parem1, parem2));
 
user8871181
parem1 is always filled with the value of the current element being processed
..and..
parem2 is always filled with the index of the current element being processed
 
user8871181
..is this part of the forEach function - and what it's supposed to do?
 
user8871181
Or am I off coarse, entirely?
 
yes, you can call the variables whatever you want, what matters is their position
 
5:06 AM
basically the forEach function provides the parameters
 
user8871181
:D
 
the first variable will get the value, the second will get the index and the third will get the whole array
 
user8871181
You guys are legends. Especially since I bet it would be rather annoying to have some JS newby asking all these questions
 
it's a little more complicated under the hood but that's the concept around the functional approach. What makes forEach different from, say reverse is how it passes parameters from the array it's called on
 
5:20 AM
@demonhunter24 if we didn't like helping newbies we wouldn't hang out in this chat
it's kinda what we are here for
most of us at least
 
Oh god my brain... David and david O-o
Oh nvm one has a lastname.
 
Hi there, how are you folks?
 
@KoboldMines 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 got 1 simple question
 
user8871181
@david :)
 
5:24 AM
How to use var {id} = data; << this syntax; how can i retrieve that variable
 
user8871181
var myID = "mydata";

console.log(myID);
 
@KoboldMines What variable? The syntax is called "destructuring assignment".
 
@All hi
 
@geisterfurz007 thanks for method name, i could not find it. i thought it created object with values {id, id_name} etc.
 
im using the below implementation to check the online offline status
window.addEventListener('offline', function(e) { console.log('offline'); });

window.addEventListener('online', function(e) { console.log('online'); });
this is working fine in mobile view and most of the browsers, but im getting issue in IE and Mozilla.
Anyone have any idea about its support for IE and mozilla
in the documentation though it shows full support
 
5:38 AM
what does it mean by offline and online?
is tab active?
 
@KoboldMines You can give names to the variables with {propNameInObject: variableName} and {prop} is just a shorthand for {prop: prop}. So your variable should be accessible with the name id
 
@g
@geisterfurz007 I also love rest spread operator (...). It saved dozens of my code lines
 
user8871181
@SamSam Look here for browser support info:
https://www.w3schools.com/jsref/event_ononline.asp
 
@demonhunter24 although it shows no support for chrome, but im not getting any issue in chrome
@KoboldMines whether the internet connectivity is there or not.
 
5:43 AM
@SamSam thanks. nice stuff too
 
user8871181
@SamSam Consider using:
https://developer.mozilla.org/en-US/docs/Web/API/NavigatorOnLine/onLine
 
...
 
user8871181
..better browser support
 
never link to w3schools
 
@demonhunter24 yes, thats what i tried.
do u mean to use,
online = window.navigator.onLine;
 
5:51 AM
Hi guyz i want to ask is there any way to fragment and angular application, into lets say shop front, admin dashboard, customer dashboard each having separate global CSS , JS and navbar and everything ??
 
Hey guys, just wanted to ask if there is any way to select all inputs on my page whichs name starts with one, two or three digits and ends with '_price' (e.g. 1_price, 12_price, 123_price should be selected - a_price, ab_price should not be selected) in JQUERY ? I know I can use $("input[name$='_price']") to select all ending with '_price', but are there any placeholders for certain signs like they are in SQL ?
 
I'd just filter them afterwards.
Might also be more verbose that way
 
6:35 AM
I literally almost had a heart attack over how git was handling my submodule lol
adios
!!afk
 
git is bad for your health
but it can make for excellent bathroom tiling
 
user8871181
7:19 AM
@KevinB why do you hate w3 so much?
 
7:39 AM
the tutorials are awful and it always gets pulled as the first result rather than the documentation
 
I always liked w3schools but now that I know a little JS and found the actual Mozilla docs
 
@demonhunter24 They've been known to be imprecise with their documentation
The reason they stay on top is because they pay google analytics well for it
 

« first day (2897 days earlier)      last day (2056 days later) »