[11:00] good morning [12:15] hola [13:27] como estas? [13:40] aGOod morning [14:35] so... ya know how some peopel say that JS ain't so bad these day. It took me all of an hour to learn that is an absolute lie. [14:36] Good morning. [14:40] jrwren: Now now now ECMASCript 6 is amazeballs [14:40] it's like JavaScript is a real language now instead of a series of poorly-though-out hacks [14:41] but then again, when you're coming from a series of pooly thought out hacks I'm sure anything looks good by comparison [14:41] nope. [14:41] its still hell, not matter what you say. [14:41] e.g. [14:41] n=["hi","mom"] [14:41] now turn that into `{hi :"mom"}` programmatically. [14:41] I'm so dumb I don't know how. [14:41] {n[0]:n[1]} doesn't work [14:42] Object.create({n[0]:n[1]}) doesn't work. [14:42] i'm just too stpuid to ever JS. [14:44] jrwren: bar = {} [14:44] jrwren: bar[foo[0]] = foo[1] [14:44] (stack overflow) [14:44] https://stackoverflow.com/questions/4215737/convert-array-to-object [14:45] wow. i'm dumb. [14:46] Nah, you're doing something that I thought you could do [14:46] but apparently the syntax isn't there for it [14:47] now how to do the same thing here: hash.substring(1).split('&').map( p => p.split('=') )//.reduce( (t,n) => Object.assign(t,{ n[0]: n[1] }),{}) [14:48] rewrite it in Python [14:48] ;) [14:48] i wish. [14:48] I find JavaScript syntax rather impenetrable when folks try to be clever [14:48] i'd be done already if it were asm, I feel. [14:49] And that's coming from someone who used to make money doing Perl [14:49] zomg, it works. thank cmaloney [14:49] shit = hash.substring(1).split('&').map( p => p.split('=') ).reduce( (t,n) => { t[n[0]]=n[1]; return t; } ,{}); [14:49] jrwren: Woo hoo! [14:50] dude, me too. I think i've still written more perl than js, even though I haven't written perl in 11 yrs. [14:50] I still have NFC what that does. :) [14:50] it turns a & separated list of pairs sparated by = into a dictionary. [14:50] It looks like it's doing URL hashing but I'm just going off of keywords [14:50] Ah [14:50] blah=foo&bar=baz becomes {blah:"foo", "bar":"baz"} [14:51] its a damn shame it isn't cleaner still. [14:51] right [14:53] Seems like there should be a lib for that [14:53] url unmangling [15:01] JS has no stdlib. [15:01] i hate npm so I refuse to pull modules [15:01] and... you just asked for a lib for 1 line of code. [15:19] Welcome to JS [15:20] thank you for your kindness. I decline the welcome. I'd rather not enter or join. [15:32] hahaha [15:32] heh [15:32] to be fair, that one line of code should be a lib. ;) [15:33] but because JavaScript is a write-only language anyway (JavaScript minification anyone?) it makes sense to just chain a bunch of functions together [15:42] i disagree strongly. [15:42] it should be in the JS stdlib, one that all browsers ship, but if not that, then I don't want it as a 3rd party lib. === Augustine_W8AWT is now known as w8awt [16:05] Good luck making that happen [16:07] it never will. [16:08] but it won't matter because node stdlib might get something and then node will compile to webasm and you'll never have a clue what is executing on your machine, just like now, only more so. [16:09] I miss jquery [16:11] jquery is still out there [16:11] but now we have about 15 other layers on top of it [16:12] we're making it so our abstractions have abstracted abstractions on abstractions [16:13] every problem can be solved with another layer of abstraction [16:15] jquery select is built into the browser now! [16:25] it turns out it is built into the browser. [16:26] x = new URLSearchParams(stringwithampersandandequals) ; x.get("foo") -> bar [16:41] Hah, that's awesome