Javascript pieces of code to make you discover new exciting features, useful tips or anything that will give you a better understanding of the subtleties of JS. This repository serves as a central location for all theses snippets.
- Switch statement vs Object Search
- .map() & .reduce()
- Methods for merging (aka concatenating) arrays
- Using Map() vs Object literals
- Weakmap()
- Sets in ES6
- Promises
- Promises Part 2.
- Promise.all vs Promise.allSettled
- Promise.race
- Proxies Part 1. introduction
- Proxies Part 2. (with Reflect)
- Proxies Part 3. makeReadOnly example
- flat() and flatMap()
- Fun with Emoji!
- Some bizarre things in Javascript
- Breaking in nested loops
- EventEmitter
- How to implement a local EventEmitter? (part 1.)
- How to implement a local EventEmitter? (part 2.)
- Using "_" in numbers for better readability
- Array: .map() vs .filter() vs .reduce()
- Generator function* and yield usage
- Usage of switch (true), an example with numeric ranges
- Symbols: property keys without name collisions
- The void operator
- Using new Set() to get rid of duplicate values in array
- Object destructuring on Array
Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - If you're writing a new snippet, do not forget to update the Minutes listing section accordingly
- Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
Distributed under the MIT License. See LICENSE
for more information.
- Carbon - Create and share beautiful images of your source code