Fibonacci sequence is very familiar to everybody. we can write the following function in 20 seconds.it works, but not efficient. it did lots of duplicate computing works, we can cache its previously computed results to speed it up.
Currying and partial application are two ways of transforming a function into another function with a generally smaller arity.
Short-circuit evaluation says, the second argument is executed or evaluated only if the first argument does not suffice to determine the value of the expression, when the first argument of the AND
&& function evaluates to false, the overall value must be false, and when the first argument of the OR
|| function evaluates to true, the overall value must be true.
You may have a big list of names you need to filter in order to remove duplicates and sort them alphabetically.
!=) operator performs an automatic type conversion if needed. The
!==) operator will not perform any conversion. It compares the value and the type, which could be considered faster (jsPref) than
Converting strings to numbers is extremely common. The easiest and fastest way to achieve that would be using the + operator.