It says in the first lines of the script "var myTextField = document.getElementById('postcode');" Then there is a whole bunch of names, starting with Helsinki. You read the code with the wrong expectation and never got the idea that they were place names, just foreign mumblejumble. I too can think of slightly more efficient ways of doing it, but WTF here only means Well, They're Finnish.

I'd not actually seen return 1, 2, 3; syntax before in Javascript. It looks like it would be a tuple, but in practice it just returns 3.

I don't get returning a tuple. Just return a damn array!

That's pretty much what a tuple is in a lot of dynamically typed languages anyways. Tuples are just the JS/Python nerds compensating for the fact that their language doesn't have real multiple return values.

That's pretty much what a tuple is in a lot of dynamically typed languages anyways. Tuples are just the JS/Python nerds compensating for the fact that their language doesn't have real multiple return values.

What's so hard about just using an array in the first place? Why even have multiple return types? (And don't anybody mention Go's dumb-dumb error codes..)

That's pretty much what a tuple is in a lot of dynamically typed languages anyways. Tuples are just the JS/Python nerds compensating for the fact that their language doesn't have real multiple return values.

What's so hard about just using an array in the first place? Why even have multiple return types? (And don't anybody mention Go's dumb-dumb error codes..)

Go's error codes are bullshit, but the problem with an array is that you can change the return values and not immediately break all the other code, and then you have to deal with a "your array's too short" error vs a "not enough output items" error. Consider the three ways to have a function that gets in C#:

I like how out parameters are so specific: you can say in the function definition "the two values this function returns are called min and max". Compare to the second that says "this function returns two values" or the first that says "this function can return any number of ints, between 0 and Int64.MaxValue".

That's pretty much what a tuple is in a lot of dynamically typed languages anyways. Tuples are just the JS/Python nerds compensating for the fact that their language doesn't have real multiple return values.

That is not JS/Python speciality, it's how most languages do it. Most languages that have multiple return values implement them as tuples. The only exception seems to be perl with it's list context.
@morbiuswilters said:

What's so hard about just using an array in the first place? Why even have multiple return types? (And don't anybody mention Go's dumb-dumb error codes..)

Tuples contain fixed number of elements of independent types, while arrays contain variable number of elements of the same type. Of course in dynamic languages there is not much difference, but deconstruction is usually only supported for tuples and they are usually optimized for this.

I'd not actually seen return 1, 2, 3; syntax before in Javascript. It looks like it would be a tuple, but in practice it just returns 3.

That's the comma operator. It's useful when you want to do something hacky and dumb like for(;;)alert('a'),alert('b') where you don't want to use any braces. Basically, it executes both arguments and then returns the second one.

That's pretty much what a tuple is in a lot of dynamically typed languages anyways. Tuples are just the JS/Python nerds compensating for the fact that their language doesn't have real multiple return values.

What's so hard about just using an array in the first place? Why even have multiple return types? (And don't anybody mention Go's dumb-dumb error codes..)

Go's error codes are bullshit, but the problem with an array is that you can change the return values and not immediately break all the other code, and then you have to deal with a "your array's too short" error vs a "not enough output items" error. Consider the three ways to have a function that gets in C#:

I like how out parameters are so specific: you can say in the function definition "the two values this function returns are called min and max". Compare to the second that says "this function returns two values" or the first that says "this function can return any number of ints, between 0 and Int64.MaxValue".