Hello, these are some interesting comparisons.
I was kinda surprised to see no example of spread in the 'Spread vs rest' section. A few examples of spread:
spread
someFunction(...someArray) ... const x = [...somethingIterable] ... const y = { ...somethingIterable }
I was also surprised to see no example of function in the 'Hoisting' section. It is the one form of hoisting that I find very useful because it allows you to optimize the readability of the code.
function
someFunction() // "hello" function someFunction() { console.log('hello') } ... function SomeComponent() { return <button type='button' onClick={handleClick}>click</button> function handleClick(e) { ... } }
An example that hopefully communicates how you can improve readability by relying on hoisting:
function mySpecialAction() { const resultOfThis = doThis() const resultOfThat = doThat(resultOfThis) return resultOfThat } function doThis(someInput) { ... } function doThat(someInput) { ... }
This helps the reader by obtaining an overview before diving into details.
Nice thank you!
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Hello, these are some interesting comparisons.
I was kinda surprised to see no example of
spread
in the 'Spread vs rest' section. A few examples ofspread
:I was also surprised to see no example of
function
in the 'Hoisting' section. It is the one form of hoisting that I find very useful because it allows you to optimize the readability of the code.An example that hopefully communicates how you can improve readability by relying on hoisting:
This helps the reader by obtaining an overview before diving into details.
Nice thank you!