I need to know if given Array has objeto with a certain value in its index.
I tried to use indexOf , but I was not successful.
arr = [];
arr.push({id: 1, nome: 'Wallace'});
arr.indexOf({id: 1}); // -1
How can I do t...
I have the following array:
var usuarios = [
{nome: "João", id: 1},
{nome: "Maria", id: 2},
{nome: "José", id: 3},
{nome: "Ana", id: 4},
];
I need to return the user index José.
I tried using indexOf as follows:
var...
I have some Vector :
public static Vector<Integer> id = new Vector<Integer>();
public static Vector<String> nome = new Vector<String>();
public static Vector<String> nascimento = new Vector<String>();...
I know that you can validate with HTML5 or CSS, but it's just out of curiosity: I found a code on the net that verifies that the syntax of a typed email is correct:
if(document.dados.email.value=="" || document.dados.email.value.indexOf('@') =...
Every time I select a bundle, I add in an array, example:
Items are some data that I get, I just passed a few to test
var items = [755, 20, "E", 274]
$scope.selectBundle = function(){
var info = {
cod: items[3],
bundl...
I have the following entry:
aaisndiaunwioun test|test saiudb8iuyb aiwbu diby tab fiubaw palavragrande|palavragrande asibtiubi
How to make the algorithm return test and palavragrande only if the before and after index of t...
I have a question about how to do data filtering when the client fills an input field. I'm looking for all server logs (running PHP) through a jQuery JSON request and would like to know how to make a less "restrictive" JavaScript filter since th...
Doubt related to how to remove only part of the text after my tags p: and r:
I'm developing an application similar to chatbot simsimi and for testing purposes I'm storing the questions and answers in a var within the script. In...
I have the following code that holds an array with 7 values, each for each day of the week. then I have to create a function that sums these 7 values (successfully completed), says what is the largest value of this Array (successfully completed)...
The case is the following. I have a script I wanted to use and as with all the questions "I suppose" I do not know how to do it. I am trying to do a search of array data with javascript "because they do not suggest other languages if your answer...