« first day (2482 days earlier)      last day (2479 days later) » 

11:20 AM
@OliverSalzburg did you check the marked answer there?
lol the only good answers have votes < 5
but it's an old question though
 
I'm confused how you can print out arrays by variable name (a[var1]) not by index number (a[0])
I always thought that wasn't allowed
I know you can declare vars in an array by var name though
 
@KarelG The answers aren't relevant to me when judging if a question is a dupe
And there are numerous other questions which ask the same thing :P
@lemon If you're indexing by name, then it's not an array
 
I dont get how alert(i) works fine but alert a[i] does not jsfiddle.net/g23erztb
 
Those are two very different things
 
oh
 
11:28 AM
And prompt returns a string
Using a string as a numeric index into an array is fucked up, even by JavaScript standards
 
I thought since i is the first element it would equal a[0]
 
@lemon The first element of an array is array[0], correct
 
oh I didnt think it was a string. ill change it to number(prompt())
 
Yeah, try that
 
@OliverSalzburg It works though...
 
11:29 AM
parseInt might even be more fitting, as array indices are usually integers
@KendallFrey I don't want to hear it!
 
ok I got it now. jsfiddle.net/g23erztb/3
so you can only use varname as an index in array definition and not in if/while/for/alert(), etc ?
 
Hey all, anyone here use Webstorm IDE?
 
@Daruchini Welcome to the JavaScript chat! Please review the room rules. Pleasedon't ask if you can ask or if anyone's around; just ask your question, and if anyone's free and interested they'll help.
 
@Daruchini It sucks
@lemon That doesn't make sense
 
oliver ... arrays are actually objects with numeric keys as strings
:P
 
11:43 AM
@KarelG I know
 
@OliverSalzburg really? what do you use? I'm doing a project with d3
 
I use sublime test 3
 
@Daruchini VS Code. We used WebStorm for years. It's a piece of garbage
 
but I suggest to have an IDE if you're not experienced with that language
i've intellij IDEA at work :|
 
Yah I defo want an IDE
 
11:45 AM
@FlorianMargaine @Loktar @KendallFrey hop hop hippity hop, you know what it is
 
@Daruchini VS Code has more IDE parts that actually work right than WebStorm
 
@OliverSalzburg I'll give it a go then! Thanks
 
use vim. Easy peasy
 
@Daruchini use vim
 
@rlemon any specific reason?
 
11:48 AM
it's a learning experience.
 
@OliverSalzburg for purely JS?
 
@GNi33 For anything
 
what do you guys use in your stack?
 
I would be hard pressed to find even a single feature in WebStorm that works as advertised
 
ham, cheese, a little bacon, tomato, and lettuce
 
11:49 AM
lul
sold on Vim
 
good luck
 
next up: vue
 
@GNi33 Mostly JavaScript
 
see you after you figure out how to close it
 
then lambdas, and I think you're golden
 
11:50 AM
cc @KendallFrey :D
 
@rlemon that's definitely the Kerbal Space Center
 
@OliverSalzburg I mean can I only use foo when putting it in array bar (var bar = [foo] and not say, alert(foo[bar])
 
that doesn't make sense
 
ffs
 
const arr = [1,2,3];
const index = 1;
alert(arr[index]);
try that
 
11:52 AM
shouldnt it be alert(foo[0])
 
no clue what you're trying to do, you need actual code examples
showing what you're trying to achieve
 
@rlemon I have a feeling that won't help either.
 
maybe, maybe not
better than what we have
 
uh, what?
 
11:56 AM
var i = parseInt(1,10) // simplified, so now i is = 1
var a = [i] // what this is doing is creating an array literal with the value of i as the first value. so basically a = [1]
if (a[i] <= 9) // this is asking if a[1] is less than or equal to nine, which it isn't because array indexes are zero based, so a[1] = undefined, a[0] = 1;
small explanation of what the top code is doing, hopefully that will make it clear for you.
well, a[i] <= 9 is true I suppose
but that's just another js wtf, focus on the array index's
 
how come its 1 not 0 it should be 0
 
What should be 0?
 
i
 
you have a prompt, it could be anything
I simplified it as 1
 
the prompt is the first thing in the array though
 
11:58 AM
@lemon I have a question for you. What exactly do you think a[i] means?
 
it means i is a variable and is the first array element
 
@KendallFrey object a with the index of the value of i
fuck
LEMON CHANGE YOUR NAME
confusing me
 
array a would be of length 0 in any case. no matter what you put in the prompt. so only if you put 0 then only its legal
 
@Parth Welcome to the JavaScript chat! Please review the room rules. Pleasedon't ask if you can ask or if anyone's around; just ask your question, and if anyone's free and interested they'll help.
 
length 0?
 
12:01 PM
length 1 index 0 :D
 
you made him change his name..
 
this name is better though it hasn't updated on my screen yet
 
oh wow.
 
@Parth :p very different things
 
@lemon No. a is an array. i is an index. [i] creates an array where i is the only element. a[i] does not create an array, it gets an item from the array that is at index i. So if i is 2, then a[i] is the third item in the array.
 
12:03 PM
@Nick good, there can be only one lemon
 
im gonna change my name to lemon
 
@rlemon yeah i know .. just a typo
 
I've got time to kill. What do I learn?
 
oh I get it now
 
@littlepootis i am also killing time just reading chats here
 
12:06 PM
Yeah, I'm lit af.
 
@littlepootis how to revive time
 
Lol. Pressing enter while selecting the name just sends the message .... :-/
 
tab complete
 
@littlepootis don't listen to @rlemon. Learn how to revive time
 
you could save Zelda
 
12:08 PM
@rlemon hmm @rlemon that works. ok :+1
 
rlemon, would LazerLemon still confuse you ?
 
how can you have letters as indexes when indexes are number based from 0 :S
thats weird right there
 
@lemon i is not the same as "i". "i" is the letter "i". i is a variable containing an index.
 
@lemon you probably want to use object with keys as letters and values you want... imho.
 
if you do i = 0 then a[i] is the same as a[0]
 
12:19 PM
@lemon though you could use "i" just the same
Not recommended for arrays though
 
how would you just store the number of a var in an array without the number saying its index n
 
huh?
 
he wants push
probably.
but all values in an array will have an index to look it up
 
I know
I just dont want the number var = 4 to define the 4th index for example
 
Then don't use it as an array index
a variable can represent anything you want it to
 
12:22 PM
 
ohh i get it now
 
19 mins ago, by lemon
oh I get it now
 
:D
 
haha that KSP
 
12:25 PM
you know howlong I've been looking for a nice list of bad words? m.dickssportinggoods.com/wcsstore/DicksSportingGoods//… and freaking dicks sporting goods is the one to deliver
 
felt the same way
 
outstanding
 
hi @rlemon
 
:hides:
 
:P
 
12:27 PM
@rlemon what?
 
@rlemon What's a yobbo?
 
@KendallFrey look at the orbit trails.
 
oh lmao
 
:3
 
@OliverSalzburg a rude, noisy, and aggressive young man.
 
12:27 PM
Huh
That fits several people I know
 
hey hey
 
Hello
 
hey @Hans1984 @rlemon hope u r fien guys
 
hey@ChewCat
yeah im alright
 
@rlemon "fat" um ok
 
12:30 PM
look i made a command for caprica
!!caprica
 
Hello everybody, is someone working with ngPrime atm ?
 
!!undo ~2
 
@rlemon TimeError: Could not reach 88mph
 
A question about git: What's the difference of 'Merge remote-tracking branch 'origin/A' into B' and 'Merge branch 'A' into B'?
 
12:31 PM
lol ha h ha
 
I found the branch color change when the latter.
 
@N1ng One is a remote branch, the other isn't
 
@N1ng One is a remote the other is local
 
So which is correct?
former?
 
Both are correct ;)
 
12:32 PM
Ok thank you:)
 
You sure you know what you want to do?
 
But I don't want the color displayed on GitHub be changed.
 
i'm also made one command @Hans1984
 
originally my branch is green
now it's black
 
xD @N1ng how long have you been working with GIT?
 
12:34 PM
@N1ng Merge commits are ugly anyway. Rebase that shit and FF-merge
 
about two weeks?
 
you did?@ChewCat
 
yeah man
 
great
 
see
!!insanehorse
 
@N1ng yes you should listen to @Oliver look here ariya.io/2013/09/fast-forward-git-merge
 
 
nice, co-founder of reddit like /r/childrenfallingover youtu.be/3vzkw2zD7gE?t=1m5s
 
lol, originally git fast-forward for me
 
not able to watch video
The uploader has not made this video available in your country.
:(
 
12:37 PM
same here
 
i usually ref to an issue when I make a comment ... but i cannot find the issue ... git search tool is not helpin much :|
 
Ok I will reset and try it again.
 
@rlemon dat HD
 
@KarelG it's a great segment.
they open some dudes fucking profile and just start scrolling down
he's got a NSFW post (just text)
 
Would have been gold if it was DoubleDickDude
I'd watch that
 
12:40 PM
:3
 
lol
 
HAHA
it's posted on reddit ofc, the dude whose profile they open is top comment
> I hardly ever posted something filthy. Ofcourse it had to be right there when Jimmy fucking Kimmel scrolls through my newest reddit history live on TV. Holy crap, you can never know... I regret nothing.
 
+1
 
bye
 
bye chewcat
 
12:45 PM
bye @Hans1984 @AshuKumar @rlemon tc
 
really?
 
bye man @ChewCat
 
@KendallFrey colin has competition youtube.com/watch?v=Ybdmk57fDxw&;
 
ohhh :(
bye milk time
 
Hello to change git account in Terminal?
 
12:52 PM
@N1ng Hello to change git account in Terminal to you to!
I don't understand the question :P
 
$ git config --global user.name "John Doe"
$ git config --global user.email johndoe@example.com
i guess u need this
@OliverSalzburg haha
 
Then git will ask me for the password of new account?
 
git doesn't have a concept of accounts
You usually use either SSH or HTTP transports, which provide authentication mechanisms
This is dictated by the remote you're communicating with
So whichever remote you fetch from or push to is what defines which account is used
If it's a remote backed by SSH transport, your regular SSH configuration applies
 
Thank you:)
 
For HTTP, you will likely get a prompt during git operations
I use SSH 99% of the time, so I'm not really sure
 
12:57 PM
hmm typing something greater than 9 in the for loop alert() still makes it count from 0 to 9
 
@N1ng for http you would be asked both username and password
 
@LazerLemon Put "Learn about console.log()" at the top of your list
 
@OliverSalzburg :P xD
 
k lol
 
seriously, what are you trying to do? that code makes no sense
 
1:05 PM
heh, obviously a fake account "... monkeyhas@tail.com"
 
don't just say count up user input
like.. think of a real world application that you're trying to make this for
 
 
there is too much wrong in that code to even begin
you're hurting yourself by not having a real application or project and just having this confusing, and mostly wrong 'sample code'
 
its to test what I've learned jees
 
1:08 PM
even something as simple as a todo or a counter app would be better than a random prompt, a bunch of leaky globals, and confusing code.
it's not helping you at all.
!!convert this application to postgres or just learn mongoose
 
@rlemon Unit this not recognized. Did you mean:
* volume: tbs
* energy: th
* time: hrs
 
well that's a major fail.
 
I'd mongoose the shit out of that application
 
morning everyone
 
1:28 PM
maybe this is neater jsfiddle.net/f8ba2cht/10
 
iamakulov.com/notes/npm-malicious-packages well fuck - node peeps. FYI
6
 
well it's being revisited because NPM still doesn't secure against it
and there are packages on that list I know some of us use
 
mongose ...
 
1:32 PM
Just don't make typos, sorted
 
easier said than done
 
https://pastebin.com/KEwaAfck
why this promise prints
out of function
out of function
in function
?
 
I could totally see myself install nodesass and not blinking an eye
 
@jagdish because it's asynchronous
 
It's like web sites. Gotta stick with the web sites that you trust with your credit card, like amazzon.com
 
1:34 PM
so what changes do i make to make it print
in function
out function
out function
 
yea but these are not new packages, they're trying to snag old ones.
@jagdish async/await or move the other code inside of the callbacks
either way, you're dealing with asynchronous functions being called, you need to work within those limitations or look for a sync solution (which is often not what you should do)
 
bbl
 
okay
 
npm lib for handling timezones ?
 
@TCat why do you have two accounts?
 
1:38 PM
2 accounts?
 
hes not chewcat
its another guy
 
looks like a greater than zero chance they're the same
 
no they are not
i know both of those guys
 
I'll continue to assume they are.
 
ok
 
1:40 PM
huh man chew in here
silent chew
no insane activity
but love you guys @rlemon @Hans1984 @AshuKumar @TCat
 
seriously. stop mass pinging me
 
sorry
time to leaving home bye all tc guys
sry for disturb Horse bye tc
 
pings rlemon by @ rlemon ... 😈
 
lol
 
lol haha bye
@Kaushik bye
 
1:44 PM
@ChewCat bye
those are very yummy @KarelG
 
@rlemon clever. I mean, actually quite stupid, but clever. I never took steps against it
 
hi
 
someone had a decent idea, don't let names with a levenshtein distance of <3 pass.
 
<3
that might be harmful though
maybe you genuinely want to make a good package, and there's an abandoned one around with a very similar name
 
I'm attempting to code a higher order function. The idea here is that the function will return the parsed rows after first calling fs.readFile. I can see this is valid syntax but not sure it is handling return of err correctly:
const syncParse = fs.readFile(inputPath, function (err, fileData) {
    parse(fileData, {columns: false, trim: true}, function(err, rows) {
      return rows;
    })
});
 
1:51 PM
I think I even abused the concept with npmjs.com/package/rebecca
 
ignoring hyphenation for identification is probably good enough
 
and I call the method like:

var parseResult = syncParse("./fileName");
 
well, the upside of implementing the levenshtein filter is that a lot more people will get to learn what it is :3
 
@BrianJ how is that supposed to work
where is inputPath coming from?
syncParse isn't a function
 
input path is coming from the first call:

var parseResult = syncParse("./fileName");
 
1:54 PM
still don't see how that could possibly work.
async function syncParse(path) {
  const data = await fs.readFile(path);
  return await parse(data);
}
looks like you want something like this maybe
 
fs.readFile doesn't return anything dude
you can wrap it in a promise, or use the callback
 
how do i use data returned by promise outside promise ?
 
you don't
well, you do, but you don't
it's async, so you need to pass it off or use it inside of the then/callback
 
hmm ok back to the drawing board :)
 
1:58 PM
I've followed a tutorial (D3js) and created a simple static bar chart: gist.github.com/Daruchini/7a95a06737b255b941e1d67a5aecc7bf I'm confused with the functions. More specifically, the parameters. I'm passing in d, i but they aren't defined as variables? How is this working
 
they're function parameters.
function(d) {
  // d is scoped to this function now as a var
}
d3 passes them to your callbacks automagically.
 

« first day (2482 days earlier)      last day (2479 days later) »