Skip to content

Tag: ecmascript-6

Is a JavaScript class an object?

I assume that an ES6 class is an object as “everything” is objects in JavaScript. Is that a correct assumption? Answer From the point of view of Object Oriented Programming class is not an object. It is an abstraction. And every object of that is a concrete instance of that abstraction. From the p…

How to flatten nested array of object using es6

I have this array of objects, within it I have another array of objects: How to get flat array of country like this: without using a forEach and a temp variable? When I did: I got the same structure back. Answer Latest edit All modern JS environments now support Array.prototype.flat and Array.prototype.flatMa…

Export default was not found

I have a Vue 2 project, and I’ve written a simple function for translating months in dates, which I would like to import in one of my components, but I’m getting an error: export ‘default’ (imported as ‘translateDate’) was not found in ‘@/utils/date-translation’…