How true hackers write JavaScript
21–30 of 342 posts
Re: How true hackers write JavaScript
#22Re: How true hackers write JavaScript
#23Also not a fan of unnecessarily cryptic variable names.
Re: How true hackers write JavaScript
#24That might be one of the most readable pieces of code that I've ever read.
function byClass (el, cl) { return el ? el.getElementsByClassName(cl) : [] }
const byClass = (el, cl) => el ? el.getElementsByClassName(cl) : []
Re: How true hackers write JavaScript
#25Re: How true hackers write JavaScript
#26That might be one of the most readable pieces of code that I've ever read.
Really? Plenty of needlessly abbreviated function names IMO. At a quick glance is it immediately obvious what posf or arem are without looking into the context in which they're being used? Don't get me wrong it's a nice piece of code but super-readable it isn't.
Re: How true hackers write JavaScript
#27Re: How true hackers write JavaScript
#28This is neat (how the up/downvote onclick handler sends the info to the server). new Image().src = el.href; Where href looks like this: vote?id=xxxxxxxx&how=up&auth=yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy&goto=item%3Fid%3Dzzzzzzzz#wwwwwwww
Re: How true hackers write JavaScript
#29That might be one of the most readable pieces of code that I've ever read.
Really? It has horrendous naming and it isn't even using es6 function byClass (el, cl) { return el ? el.getElementsByClassName(cl) : [] } const byClass = (el, cl) => el ? el.getElementsByClassName(cl) : []
Re: How true hackers write JavaScript
#30That might be one of the most readable pieces of code that I've ever read.
Really? It has horrendous naming and it isn't even using es6 function byClass (el, cl) { return el ? el.getElementsByClassName(cl) : [] } const byClass = (el, cl) => el ? el.getElementsByClassName(cl) : []