Can Jow Forums get the free coffee?

Can Jow Forums get the free coffee?

Attached: .jpg (500x500, 124K)

Other urls found in this thread:

developers.google.com/web/updates/2018/03/smooshgate
twitter.com/NSFWRedditImage

"coffee.secret word: parameters"

>"var"
Dropped

>split('')
>not [...s]

> javashit

Attached: maxresdefault.jpg (1920x1080, 165K)

>could probably use
thats not them giving it to you

really makes me want to study programming, so I can become a barista at a fag joint

>writing it purposefully out of order just to catch out the n00b k0ders

var reverse = function(s) {
return s.split("").reverse().join("");
};


Why not
function reverse(s) {
return s.split("").reverse().join("");
}


?

I seriously don't understand the need to encapsulate everything into variables. Fucking Gen X'ers and their superior Javascript.

Sorry what? Both of those are the same code, except that function statements are subject to hoisting.

Anyone that's not a programmer with at lest half a brain can decode this.

>you need a CS degree to serve coffee to hipsters
sad really
let yourDrink = 'coffee'
let barista = {
str1: 'ers',
str2: [...'arap'].reverse().join(''),
str3: 'met',
request: function (preference) {
return preference + ' secret word: ' +
this.str2 +
this.str3 +
this.str1
}
}

console.log(barista.request(yourDrink))


also that's a woman's handwriting.

I don't even know Java and I can tell you what that says.
> inb4 don't even know Java
I'm a C purist you niggers.

by default declaring a function in javascript creates it in the global scope which can cause problems if you are using 3rd party/legacy libraries that don't encapsulate their code so you could accidentally override some of those functions.

that's javascript tho.

>function statements are subject to hoisting
So are var variables.

>maxresdefault.jpg
found the faggot

>know how to code
>serve coffee for a living
can someone explain this to me?

I think it might be related to this being very shitty javascript code.

There's a chance that at that skill level, you get sucked into competing with a world of "web programmers" that work at $5/hour or whatever.

Might actually easily earn more with your own coffee shop / restaurant or whatever.

PS: Of course maybe the shop owner is better at programming than that and just didn't want to be too elitist about who he's drawing in for a free coffee.

Can't tell from such code snippets, I guess.

Also obviously maybe one of the regulars or a friend wrote this shit.

TypeError

how can you know that

Maybe he just likes it and coding is an hobby?

Attached: r_767383_5qZs1.jpg (600x376, 29K)

I can't even code and I can figure this out from simply looking at 3 of the lines.

>learn javascript
>end up serving java

The state of CSfags

students can also work

>tfw kill Flash
>197358917382 JS frameworks pop up
>"code artisans" become a thing
>pic related becomes trendy and quirky
>le code for le covfefe xdddDDdd
>code literally anybody could figure out with zero programming knwoledge
>CODERS AMIRITE?????
>as long as Flash "lived" it wasn't this much of a problem
>tfw Flash was the barrier that held the gates of hell closed and we cheered for its destruction
RIP programming

>>pic related
I meant op pic, fuck

Fuck I hate Javascript.

what's wrong with javascript user?

Is it "Secret Word: Parameter"? I don't even code

They owe Oracle $25 a year for that sign.

Attached: GeraldShow.png (320x502, 65K)

no, it's parameters

no. it's just "coffee"

Spread is a meme replacement for Object.keys(). Don't use it.

>Not doing a wizard tier obfuscation with C code

Too easy, the coffee is probably shit

That occurrence could literally happen in any language.

actually it's "coffee.Secret Word: parameters"

How do you figure?

He just spelled out part of it.

The second one is illegal in block scope.

this

Maybe it's a cute trap like my japenis cafe animus

>var
stopped reading there

even without knowing coding you could decipher this with ease.

>hipster
>uses spread operator
ok

Attached: 1488015180285s.jpg (113x125, 3K)

>tfw Flash was the barrier
You are extremely retarded if you found flash hard to use. btw most people use nodejs, so who cares.

Attached: 1529611417297.jpg (500x592, 73K)

parameters! one free so ylatte with extra skimmed so ymilk please!

cringe

>declaring a function in javascript creates it in the global scope
Thanks for this. For a moment I was considering to abandon my current plan and take the easy way and just become a webdev javascript programmer.
This really slapped some sense into.

Arapersmet

What . Literal ooga booga language

Attached: DNMfVanXkAAYGl2.jpg (810x592, 80K)

Is that really how you reverse a string in JavaScript? You can't just do "arap".reverse()?

The only proper way to order coffee there is to establish your dominance by picking the first option and calling the waiter's mother a whore.

I don't drink coffee, it's detrimental to the quality of your sleep as you get older.

No

You turn the string into an array and then you reverse the order of the array and put it back together, sucks but whatever I guess

Could also use s => {
Instead of function(s){

this

my dads 55, maybe 4 hours of sleep max

That's a great marketing idea desu

>Inb4 some shit reply
Go ahead and dont

Those variables are never reassigned. There is no reason to use let. You should use const.

Also, if you're using spread you might as well return template strings

I am 50. 7 hours. Your dad is a bitch.

>camelcase
>javashit
DROPPED

Attached: file.png (728x546, 243K)

>not ordering something by asking for it by number, forcing the employee to look themselves because not enough people do that for them to know what one you're talking about

const yourDrink = 'coffee'
const barista = {
str1: 'ers',
str2: [...'arap'].reverse().join(''),
str3: 'met',
request: preference => preference + ' secret word: ' + this.str2 + this.str3 + this.str1
}

console.log(barista.request(yourDrink))

ftfy

>an hobby

>coding
>as a hobby
Why would anyone do that to themselves?

...
...
...
because reasons.

Maybe it's a coffee shop near a university that teaches CS?

kernel style
#define COFFEE(cof) __COFFEE(cof)
#define __COFFEE(cof) \
__attribute__((coffee))__DO_COFFEE(cof, \
pref, bar)

>JavaScript
>ES5

I'd rather go to Starbucks.

Attached: 1521105083364.jpg (1536x1024, 460K)

I'm pretty sure there was a proposal with String.reverse() method for years now, but it will never be implemented because of some legacy code bullshit. Just like Array.flatten().

Attached: 1516217312980.gif (400x256, 690K)

Games tend to launch with lots of broken code if you want the game to work well you need to fix it.
Also Fixing crap code can be fun once you get it working.

it's not, but it does invoke whatever iterator for a string. without benchmarking I can't say if you should or should not avoid using spread for a string to mimic String.prototype.split

wrong. spread can be used to variadically call a function as well and also as a way to capture variadic args without the infamous and shitty "arguments"

it is not intended as a replacement for Object.keys as it does a fuckload more than Object.keys

this. maybe you'll get a string.smoosh() though.

No, they couldn't have. Using an arrow function would bind the context to the top level context there, and "this" wouldn't work right. Arrow functions aren't syntactic sugar for functions. They work differently.

No, you stop that shit right now. See If you're that desperate to save some keystrokes:

const yourDrink = 'coffee'
const barista = {
str1: 'ers',
str2: [...'arap'].reverse().join(''),
str3: 'met',
request(preference) {
return preference + ' secret word: ' + this.str2 + this.str3 + this.str1
}
}
console.log(barista.request(yourDrink))


Seriously, learn about contexts and stop blindly using "sexy" language constructs when you don't understand what problems they solve.

Attached: ta8iyfo57ugz.jpg (429x571, 55K)

>coffee secret word: undefinedundefinedundefined

kek you did not get the job

>ymilk
Did you mean basedmilk? ...onionsmilk. Fuck. basedmilk

>it will never be implemented because of some legacy code bullshit

I expect it's more to do with not wanting to bloat the standard with stupid shit that won't be used by most people. I can see myself needing to reverse an array in production. I can't think of any case where if need to reverse a string except for an interview question.

>no dangling comma
sad

why is everything in javascript now lmao

no, it's literally exactly what he said, there are probably known uses of retards implementing String.prototype.reverse. same reason "Array.prototype.flatten" was renamed to "flatMap"

tc39 is full of massive faggots with retarded and warped sense of "legacy"

>no if statement to see if they can read it in the first place

because it's the most universal language right now.

gnome has gjs.
nodejs exists.
browsers are basically universal toolkits.

V8 is retardedly fast given how fucking atrocious javascript is.

the real question is, why isn't javascript even larger?

I actually thought about it, but I decided to match the style of the existing code.

When given the option, dangling comma is always the way to go.

Attached: 60d7cfa7b5048bd.jpg (326x302, 23K)

where do you live so i can beat the shit out of you

developers.google.com/web/updates/2018/03/smooshgate

I learned recently they added dangling commas to function call syntax as well.

>>The joke was not clear to everyone, some people started to incorrectly believe that the new name had already been decided, and things escalated quickly.

>this is what tc39 fags believe.
I don't think a single person I knew believed it was a serious contender and not just a huge joke that made tc39 look retarded.

>return preference + ...
When was "preference" ever defined?

>>tfw Flash was the barrier
>insecure, proprietary, walled garden garbage was the barrier
Sure buddy

It's defined in the function and passed in as yourDrink from global scope at barista.request()

....as a function parameter?

duh?

Oh, I'm blind

I came to this conclusion just by reading the goddamn thing. I don't know coding and I can't even build my own PC. What a bunch of posers.

I cringe every time I see normies using "code" in jokes and thinking they are funny.