Skip to content

Category: Questions

why is this Vuex state syntax throwing error?

I’m quite new with Vuejs & Vuex, I created a local project just to practice, so I have a file called: employeeList with an Array of objects. I’m trying to pass that same Array as state in Vuex, but is throwing me errors. I assume the syntax is wrong, please tell what would be the correct appro…

Collecting random year from Random Date

So I have generated a random date from two dates Now I need to collect the year of the random date generated with the code: var yearOfInterest = dateOfInterest.getFullYear(); This does not work. I would appreciate the assistance. Thank you. Answer A function definition does not need the var, just assign the f…

Sort array without any sort methods using JS [closed]

Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers. This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers. Closed 4 m…

How can I sort and operate on unique key values

I want to iterate though an array of different ratings, sort by each unique id, sum and calculate the average of each id’s ratings. Then save the averages in a new array, where I can call something like averageRating[i], where each entry will be each id’s rating. The original array of objects look…