30 questions
Filter
- 0 votes1 answers15 views
JS Multidimensional array search by value
Following is the js array I have [{"tagid":10,"packagecount":62,"destinationcountry":"IN","tagname":"Fibroidsssssssssssss"},{"tagid":21,"packagecount":22,"desti...
- 0 votes1 answers19 views
PHP multidimensional array search by value
I have an Array which have multidimensional values Following is tags array Array ( [0] => Array ( [id] => 10 [name] => Fibroidsssssssssssss ...
- 0 votes1 answers14 views
How to append something to an array?
How do I append an object (such as a string or number) to an array in JavaScript?
- 1 votes2 answers46 views
What is the difference between slice and splice in JavaScript array ?
What is the difference between array slicing and splicing ?
- 1 votes2 answers16 views
Convert Array to Object
What is the best way to convert: ['a','b','c'] to: { 0: 'a', 1: 'b', 2: 'c' }
- 2 votes1 answers476 views
How to compare arrays in JavaScript?
I'd like to compare two arrays... ideally, efficiently. Nothing fancy, just true if they are identical, and false if not. Not surprisingly, the comparison operator ...
- 2 votes1 answers32 views
how to write function to generate an array between two integers
Test Data : console.log(rangeBetwee(4, 7)) // [4, 5, 6, 7]; console.log(rangeBetwee(-4, 7)) // [-4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7];
- 2 votes3 answers57 views
How to filter unique array members?
How to create a function that should return an array with unique items of arr. For instance: let strings = ["Hare", "Krishna", "Hare", "Krishna", "Krishna", "Krishna", ...
- 3 votes6 answers45 views
Spread Operator in Javascript
How to concat 2 arrays using spred operator? let arr = [1,2,3]; let arr2 = [4,5]; `
- 4 votes1 answers23 views
How to extract array data only having multiple values in Javascript?
I have this array data. var arr = {key1:'progress',key2:'done',key3:['new','12'],key4:['checking','10']}; and I want to extract array data, but it should only ...
- 1 votes1 answers135 views
map, fiilter and other array functions not works on document.querySelectorAll result
How to use map and filter in the console, I have Uncaught TypeError: document.querySelectorAll(...).map is not a function
- 1 votes0 answers16 views
How to loop an array in C#
What is the best way to loop an array in C# in point of view of performance? I know there is a for loop and foreach loop.
- 4 votes2 answers222 views
how to check is array symmetrical or not?
for exapmle this Array const arr = [55, 1, 'a', NaN, -0, 48, 0, NaN, 'a', 1, 55];
- 1 votes1 answers15 views
How to get random values from a JavaScript array?
How can I get values randomly from this array in the sample below? var myArray = ['January', 'February', 'March']; `
- 0 votes1 answers603 views
Opposite of 'push()' in JavaScript
I need help with this problem - 'What is the opposite of the JavaScript push(); method?' Like, say I had an array - var exampleArray = ['remove']; I want to push(); ...
- 1 votes0 answers9 views
How to add property to all objects in array?
I have the following array of objects: let array = [ {'a': 12, 'b':10}, {'a': 20, 'b':22} ]; How can I add a new property c = (a+b)/2 to all objects of the array?
- 1 votes1 answers18 views
For-each over an array in JavaScript?
How can I loop through all the entries in an array using JavaScript? I thought it was something like this: forEach(instance in myArray); Where myArray is my array, ...
- 0 votes0 answers17 views
How to copy an array using jQuery.
I need to copy an (ordered, not associative) array of objects. I'm using jQuery. I initially tried jquery.extend({}, myArray); but, naturally, this gives me back ...
- 1 votes1 answers378 views
How to find the largest product of an array in JavaScript?
This task is taken from https://www.interviewbit.com/ > Given an array of integers, return the highest product possible by multiplying 3 numbers from the array >Input: >array ...
- 2 votes2 answers5 views
How to filter objects out of an array in JavaScript
I have an array of objects arr. One object looks like this: obj = { name: 'name' email: 'email' } And then I have an array with strings (emails) var excludedEmails ...