@pitaj said in NodeBB Forum looks jacked up on my Desktop using Chrome:
Try clearing your cache.
That seemed to work. Odd. Thanks.
My favorite features so far are Destructuring, Arrow Functions, and all of the new String operations, especially templates.
My favorites (in no specific order):
startsWith
, endsWith
...
(function parameters and reducing array to its elements)I'm currently taking baby steps towards ES6
As a non-developer. What the heck is ES6, and why is it made of node.js magic?
function (player) {
var strength = player.strength,
agility = player.agility,
wisdom = player.wisdom;
}
I so want this...
player => {
var {strength, agility, wisdom} = player;
}
@yariplus Hahaha, the main thing I am worried about is that it looks like Greek to me! (no offence to Greeks on this board )
Perhaps with time that syntax will become easier to parse, but right now (as with a bunch of other ES6 examples), my brain fuzzes out and I have no mental modal of what the output is supposed to look like.
e.g. var f = (i) => arguments[0]+i;
wat.
@frissdiegurke I am also excited for the eventual deprecation (or should I say "eventual falling-out-of-favour") of var
in favour of let
. Bring it on!
There's .startsWith()
and .endsWith()
in ES6? Funny, we already use those in NodeBB
I've been using ES6 for few months already in our project because we have an ES6 to ES5 transpiler (Babel). There is an unwritten rule now in the team to only use let
and const
. The var
thing never happened
At the beginning I thought arrow functions were super ugly, but now that I got used to them is fine. You can even omit parenthesis, curly brackets and return
keyword quite frequently. But I think the best part of arrow function is that it implicitly binds this
object so there is no need to specify function() { }.bind(this)
anymore.
Anyway, my favorite one is template strings. We make custom elements so we usually need a lot of strings with variables. This feature is super handy
If I'm not wrong async/await is actually for ES7, right?
@yariplus your syntax is wrong, should be curly braces, not square brackets. Square brackets are for arrays.
@julian been using ES6 in my newest project with webpack and Babel, you get used to it really fast. Also, async and await are not ES6 features.
Anyways, Julian, I think NodeBB should adopt the Airbnb style guide with ESlint. It's an amazing guide.