Questions tagged [arrays]

An array is an ordered linear data structure consisting of a collection of elements (values, variables, or references), each identified by one or more indexes. When asking about specific variants of arrays, use these related tags instead: [vector], [arraylist], [matrix]. When using this tag, in a question that is specific to a programming language, tag the question with the programming language being used.

0
votes
0answers
2 views

Grab html element and put it into an array

I want to grab elements from html and put it in an array in JavaScript. I have tried making variables with document.getElementById and then used that in the array, however it did not work.
0
votes
0answers
8 views

javascript json data map issue

[ { personId: 1, name: 'John', surName: 'Sur', bookId: 1, bookName: 'Lord of the ring', updated_at: 2022-01-24T19:20:53.742Z, deliver__date: null }, { personId: 1,...
0
votes
0answers
8 views

How to count similar words in a string and display their individual count in a new string?

I am trying to create a function that takes in a string as an input. This function should count each word and display a count number next to the individual word. The count should increase per ...
0
votes
0answers
5 views

Traverse dynamic JSON properties [duplicate]

I have a JSON file with the following contents: { "calendar": { "dateToDayId": { "2016-08-24": 370271, "2016-08-22": 370206, "2016-...
0
votes
0answers
20 views

SQL insert array of string - issues with .join(', ')

Currently I create a string with JavaScript that is used as a SQL query. It reads a number of rows from an Excel sheet and then creates the SQL query by combining all those datapoints with .join(','). ...
0
votes
0answers
12 views

Sorting js array containing number as string [duplicate]

I have a js array like this [ { id: '111111', wbs: '1'}, { id: '22222222222',wbs: '1.2.1'}, { id: '3333333333', wbs: '10'}, { id: '4444444444', wbs: '2.1.1.1.1'}, { id: '55555555555', ...
-6
votes
0answers
23 views

How do I utilize a Java Scanner? [closed]

so in my school there was no beginner Java, we only had a Java oriented programming. I don't know Java. We have an exercise from the book Java programming 9th ed by Joyce Farrell. the code is Page 460,...
0
votes
1answer
16 views

Iterate through/compare values in arrays and print string based on result, IndexError: out of bounds

Trying to create a win/loss/tie list based on team scores. My attempt: #import numpy import numpy as np #create array for week numbers week_number = np.array(['Week 1','Week 2','Week 3','Week 4','...
-3
votes
1answer
18 views

How to print the following output Itinerary: NEW YORK to FRANCE to ITALY to ATLANTA to SALT LAKE CITY [closed]

I am wanting to print the following output: Itinerary: NEW YORK to FRANCE to ITALY to ATLANTA to SALT LAKE CITY. Please note that my program will prompt you for a series of destinations. The user will ...
0
votes
2answers
31 views

Numpy - Array to Matrix

I am writing a python script where I input a numpy array and return it as a matrix; however, with some of the values changed. Running this code, I get an error saying; IndexError: arrays used as ...
0
votes
2answers
15 views

Count how many times a value occurs with another value in a multidimensional array | PHP

So i have this multi-dimensional array , what i want to do is get how many times a value occurs with another. For example: Ball , Jungle and Car appears together 2 times , Ball and Car appears ...
0
votes
0answers
24 views

Convert array of n strings to symbol *

I need help solving this task if anyone had a similar problem it would help me a lot. The task is: Write a function (not allowed using other functions) that modifies the string s by changing each ...
0
votes
0answers
21 views

Best way to filter array in nested array

I need to find a better way to implement an extraction of an array from a bigger array and filter that sub-array into a new one, I want to avoid using for loop into another for loop, i think this ...
1
vote
1answer
21 views

How to loop through JSON object with an array with backslashes inside in Jquery/Javascript from AJAX call

I have an array where I want to loop through the array inside the JSON and show the data in the table based on the nationalities in the array. The problem is that the array data contains backslashes ...
-2
votes
0answers
18 views

Displaying nested JSON tables

I need a solution to solve this using JS, HTML, CSS only. Fetch json data and display it on an HTML element, This is what is should look like: result This is what I made so far: https://jsfiddle.net/...

15 30 50 per page
1
2 3 4 5
25719