DMDaniel Martorellindmartorell.hashnode.dev·Aug 27, 2021 · 1 min readPassing default values to an object parameterPassing default values to function parameters can avoid nasty 'undefined' surprises and give us better control over our code. Open parenthesis, write a variable name, add equals, write the initial value you want, and close parenthesis. Easy peasy. No...00
DMDaniel Martorellindmartorell.hashnode.dev·Jul 14, 2021 · 1 min readUseState performance featuresI just came across two lesser-known features of the useState hook in React : 1 - Lazy initialization Rather than simply passing the initial state you can call useState with a function that returns the initial state. This way, the initial value is on...00
DMDaniel Martorellindmartorell.hashnode.dev·Jul 5, 2021 · 2 min readMemoizationEven though you made sure your computer was installed with the hottest technology, all the excitement will be over once you try to calculate the 40th Fibonacci number. The guy has been gone for almost 800 years but his famous sequence is still making...00