Filter
Exclude
Time range
-
Near
In modern JS code, there is not function at all.
1
Yes. It is. But B works much better in most cases.
1
I prefer C const greetings = name => `hello ${name}`
1
4
In this case I prefer C... The one that says: const greetings = name => `hello ${name}`;
1
4
I prefer B because it's more intuitive especially for recognizing spaces.
B, arrow functions are my go to function syntax, it is far easier to read and follow. Plus template literals are awesome for writing long codes and creating DOM elements. For one into reactJs, it gives that jsx feeling
1
I think A is faster than B intern of performance.
1
Yea. Sometimes you need to code with ES5
1
In this short example it doesn't matter that much. But for a more complex concatination B is the correct way to go. No worries about whitespace, functions and a is for additions.
1
3
Being honest I take the second one. it's more clear
1
B is a lot better. You don't have to worry about escaping quotes and you dan put expressions in it
1
3
Following this example you can go shorter like this: const greetings = name => `hello ${name}`; ❀️
2
You are on the right track. Not only B is using template literals but also it is taking advantage of arrow functions which are both great capabilities offered by es6.
1
Oh! Ok i didn't know that! Thanks a lot mate!
1
1
Exactly
1
A loooks readable and easy to write!
1
2