News for hackers. Stuff that matters.
Re:A summary of ECMAScript 6 features by z3t4 on Monday February 16, 2015 @07:32AM (#9056596)
I'll try to interpret the code ... You have an array of string values. You use the .map function to iterate through all the strings. For each string you change the string to whatever is returned from $(x).val()

(basically just juggling data, you should make a real world example.)

I have seen Jquery before so I know $ returns a document element. And if you pass # into it, it will return getElementById(). And .val() returns .value

So my guess is that you want to get the values of hp, mp, gp, whatever that is. I don't understand why you want them in an array though!? Wouldn't it be better to store them in an associative array? So that you don't have to remember what position in the array points to what value.

Try this instead:

  var signupForm = getFormData("signupForm");
  alert( "Your name is " + signupForm["name"] );

Or without the abstraction:

  var name = document.getElementById("name").value;
A little more characters to type, but you don't have to learn a framework to know what it does. A trick here is to use keyboard macros to do the boilerplate. Don't var PI = Math.PI because of laziness.
Re:A summary of ECMAScript 6 features by jarcane on Monday February 16, 2015 @09:12AM (#9056951)
A trick here is to use keyboard macros to do the boilerplate.

Yes, I can see my preceding correspondent was correct in discontinuing this engagement. Sorry to have wasted our collective time.

Re:A summary of ECMAScript 6 features by z3t4 on Wednesday February 18, 2015 @04:24AM (#9067656)
I prefer document.getElementById("myKitten") because it's easier to read and more describing then just $("#myKitten")

If it's too long to type, and you use it often, make a macro for it. When naming stuff, keep it short and simple though.

Also, you shouldn't hide logic behind names. I was actually wrong about evens.map(v => v + 1); If that's what you want to do, then write that. It's a thin line though, it might be hard to know what "v" is in that context.