Skip to main content

All Questions

Tagged with
0 votes
2 answers
22 views

How do I use the find() method to query a mongoose schema with an enum field (can hold multiple values (array)) that includes a particular value?

I have this schema: const User = new Schema({ firstName: { type: String, required: true }, lastName: { type: String, required: true }, mobile: { ...
Textbook's user avatar
  • 119
0 votes
4 answers
119 views

Create an array using item from different array

I need to create a new array of objects with 12 item (months & value) on it but it must check if the month exist on other array. If it exist it will push onto the array if not it will have a value ...
Monmon's user avatar
  • 39
-2 votes
2 answers
57 views

Javascript Nested JSON get parent results from child [duplicate]

I have a nested JSON and I'm getting the "variants" results from API. And I'm trying to get this variants parent names. Here is the json: { "active": true, "main":...
kront's user avatar
  • 43
1 vote
2 answers
40 views

is there anything simple and less line of code to check the pass and user and check if its matched

I want to check if the user and pass is matched and also their indexes since im using array of objects im using localstorage and javascriptfor this activity //find user if exist var founduser = ...
Jazshi Omelete's user avatar
0 votes
2 answers
47 views

Button to find elements in an Array

I am trying to make a site where the user can hit a button and it will return data from the array. For example, a button called 'show male dogs' should bring back the 3 male dogs in the array. I am ...
Maureen Flannery's user avatar
0 votes
0 answers
12 views

Case insensitive search jQuery [duplicate]

Please help me with a question. There is html with this structure (simplified): <div id="data"> <div description="Andy"> <div class="ig"><a ...
Genesis Rhapsodos's user avatar
-1 votes
1 answer
117 views

Explain Javascript array iteration methods?

To perform a performance test for JavaScript's built-in higher-order functions for map, filter, find, you can use the performance.now() method to measure the time it takes to execute each operation. ...
Apurv's user avatar
  • 105
0 votes
1 answer
130 views

How to search and highlight text in HTML page from varies elements (not just one) using vanilla javascript?

I want to search for text, word, or letter, using a search bar on my webpage, which highlights the word I searched or letter on the page, I saw a tutorial for the same but they use only one element (...
Yazan's user avatar
  • 1
-2 votes
1 answer
54 views

Recursive code that returns the sums of an array that match a target

the following code shows all the possible sums equal to a target in an array, my problem is that I understand the logic of how it works in the first answer, however I do not understand how recursion ...
Erick Armijos's user avatar
0 votes
0 answers
49 views

Using find returns undefined?

After several days, suddenly this foundation of my project breaks and I have absolutely no idea why. If someone has any insight as to what's going on here, I would love to know. I am saving data for ...
ifaus's user avatar
  • 11
0 votes
0 answers
33 views

Meteor/Vue: Display result of search

I would like to add a search field to my app and show all articles from my Collection that match the entered value. The searchArticles method is called but the values are not shown as defined below ...
AntonSack's user avatar
  • 1,041
0 votes
5 answers
67 views

How to get an object property value from an array using the value of another property

I want to get the value of a property from an array of objects using the value of another property let's say I have the following array: const objArray = [ {car: 'BMW', price: 2000}, {car: '...
rainman's user avatar
  • 2,617
0 votes
2 answers
200 views

How to toggle a todo completed option?

I'm expecting clicking the Done/Undone individual task button to toggle the task data completed to opposite using Vuex store actions. But I'm getting the 404 error. Even though I'm passing the task id ...
user avatar
-1 votes
1 answer
28 views

How can I use find( ) to search for a specific matching Element but have it display an alternate element inside that same object?

I really hope i used element and object correctly in the title. My apologies ahead of time if i defined them incorrectly. I struggle with that. So the array given to me looks like this const ...
Nikki Marie's user avatar
-2 votes
2 answers
56 views

how to use the find method to look for objects in an array?

i am tryong to make an array and be able to find the objects inside the array but whenever i do that it always gives me only the firstindex let merchandise = [ { item:"Fan", price:800, }, { ...
Richard adebanji's user avatar

15 30 50 per page
1
2 3 4 5
41