Useful JavaScript tips
This is an awesome project about short and useful JavaScript tips that will allow you to improve your code writing. With less than 2 minutes, you will be able to read about performance, conventions, hacks, interview questions and all the items that the future of this awesome language holds for us.
Tips are added frequently (read further if you want to stay in touch).
If you found a JS Tip useful or you like a writer of the community now you are able to show some respect and support with a tip!
Sure, you can help the project in two ways, sending your tip or reviewing future tips. Any improvements or suggestions are more than welcome! Instructions are here.
There are a lot of ways to get updates, choose your own
- Official Blog
- Official Twitter Account
- Hubot
- Slackbot
- js2016.tips
- Hingsir
- Awesomelists
- iOS App
- Android App
Don't forget to Star★ the repo, as this helps promoting the project!
- 60 - Three useful hacks
- 59 - ES6, var vs let
- 58 - Breaking or continuing loop in functional programming
- 57 - Comma operator in JS
- 56 - Copy to Clipboard
- 55 - Create an easy loop using an array
- 54 - How to use optional arguments in functions (with optional callback)
- 53 - Get File Extension
- 52 - Return Values with the 'new' Operator
- 51 - DOM event listening made easy
- 50 - Helpful Console Logging Tricks
- 49 - Easiest way to extract Unix timestamps
- 48 - Reduce builtin function usage
- 47 - Basics: Declarations
- 46 - Detect document ready in pure JS
- 45 - Calculate the Max/Min value from an array
- 44 - Know the passing mechanism
- 43 - Use destructuring in function parameters
- 42 - Preventing Unapply Attacks
- 41 - Array average and median
- 40 - Using JSON.stringify
- 39 - Advanced Properties
- 38 - Flattening multidimensional Arrays
- 37 - Deduplicate an Array
- 36 - Observe DOM changes in extensions
- 35 - Assignment Operators
- 34 - Implementing asynchronous loop
- 33 - Create Range 0...N easily using one line
- 32 -
Map()
to the rescue: adding order to Object properties - 31 - Avoid modifying or passing
arguments
into other functions — it kills optimization - 30 - Converting truthy/falsy values to boolean
- 29 - Speed up recursive functions with memoization
- 28 - Currying vs partial application
- 27 - Short circuit evaluation
- 26 - Filtering and sorting a list of Strings
- 25 - Using immediately invoked function expression
- 24 - Use
===
instead of==
- 23 - Converting to number fast way
- 22 - Empty an Array
- 21 - Shuffle an Array
- 20 - Return objects to enable chaining of functions
- 19 - Safe String concatenation
- 18 - Rounding the fast way
- 17 - Node.js: Run a module if it is not "required"
- 16 - Passing arguments to callback functions
- 15 - Even simpler way of using
indexOf
as a contains clause - 14 - Fat Arrow Functions #ES6
- 13 - Measure performance of a code block
- 12 - Pseudomandatory parameters in ES6 functions #ES6
- 11 - Hoisting
- 10 - Check if a property is in an Object
- 09 - Template Strings
- 08 - Converting a Node List to an Array
- 07 - "use strict" and get lazy
- 06 - Writing a single method for arrays and a single element
- 05 - Differences between
undefined
andnull
- 04 - Sorting Strings with accented characters
- 03 - Improve Nested Conditionals
- 02 - ReactJS - Keys in children components are important
- 01 - AngularJS:
$digest
vs$apply
- 00 - Insert item inside an Array