Long-awaited version 3 of the popular Vue framework is finally released (after 6 months in beta and release candidate), packed with interesting new things for Vue developers. Named “One Piece” and hosted in a separate repo, vue-next, for a period of time (to avoid being confused with 2.x and also not to be picked by […]
javascript
Javascript for of index
Starting with ECMA 6 we have a new loop iterating statement in the form of for…of. This helps us to loop thru an iterable object (array, string, map, set…) in a simpler fashion than the classic for loop. To achieve this, we are going to use the entries() method of the Array: for (const [index, […]
Fetch data needed on component’s template in Vue before render
Let’s say in your Vue app you have a component that needs to fetch some data in order to display it on the template. This component needs this data on creation in order to be able to bind it on the template. Let’s take the following example: <template> <div class=”container”> <p>Name: {{name}}</p> <p>Age: {{age}}</p> </div> […]
Deepcopy of JavaScript Objects and Arrays using lodash’s cloneDeep method
While developing JavaScript applications, often we need to make copies of Objects or Arrays containing Objects. Then we want to work with those copies without affecting the original objects. In a common scenario, we are going to deal with a simple, one level Object (an Object without other Objects nested inside), like in the following […]