Category "arrays"

How to assign key to each Item or value in array in javascript?

I have an array like this: [link1,link2,link3] But I want it like this: [uri:link1,uri:link2,uri:link3] Please guide me over this. Thanks.

How do i copy an array from a lua file

I Want to copy an array from a text file and make another array equal it so local mapData = { grass = { cam = "hud", x = 171, image

Describing a numbering system that counts from x at the y position in an index

From a theoretical perspective, I'm interested in learning how one would correctly describe a numbering system that starts counting from x at the y position in

Angular show hide with combine condition

I have an array of object need to show hide based on filter like below: HTML CODE: Filter: <div (click)="filter(1)"> F1 </div>

ReactJS push to state array replaces every exisitng value in array

I want to push an 2d array into the end of a state. But somehow, when i log the state every time it changes with a useEffect, i replaces every existing array wi

Unexpected Output error in array analyzer program

Currently I am trying to solve the following problem: Ratiorg got statues of different sizes as a present from CodeMaster for his birthday, each statue having a

How to put data inside a customize state in for loop in functional component

I get the data from the API as follows: [ { "GroupA1": [ { "code": 10, "name": "item1" }, { "code": 11,

LUA - How can you generate an array of numbered variables?

I'm sorry if my question is stupid, I'm not a programmer, but I'd really like to write a tool to help me generate color gradients. Until now I've had this huge

iterate through complex nested json array javascript

nested json structure Json Structure: { "id": "30080", "dataelements": { "Name": "abc", }, "children": [ {

Map Typescript generic array

Suppose I have an object with a static set of keys, and then a type specifying a subset of those keys as a static array: const myBigStaticObject = { key1: ()

getting total size of ArrayDataProvider

I am using a knockout computed function to update a list with a filter based on inputs from user. This list has some predefined data, and when the filter is app

How to generate numpy arrays with random regions with rectangular shape with random size?

I would like to generate a binary array (values are 1s and 0s) filled with rectangular regions. Something like this: a = np.array([0, 1, 1, 0, 0] [

Random array element creation into Dom only once JavaScript

I've got a problem to insert a random array element into the DOM. I want it to only do it once for each array element but the code keeps fetching the element in

How to copy char array of a structure into another char array of a structure?

#include <iostream> using namespace std; struct stud { char name[10]; int id; }; int input(stud a[], int size) { for(int i=1; i<=size; i+

Distirbute Candy - Finding minimum reproducible example of the problem

The question is to distribute candies to N children.Each child has a rating. Distribution should be such that each child have at least one candy and children wi

how do i make a picture box hide and show on click within an array?

im having trouble with a project which requires me to make a picture box inside of an array disappear when i click it, but for some reason, im having trouble ge

how to filter array to only pick last changed value of same id of object in react

This is the function i run on OnChange in AvField let selectedFieldArray = [] const templateValue = (e) => { const fieldObject = { "id": e.target.

Allocate a vector of bytes on stack in assembly x86

I try to put on stack the values contained by array_output but every time I print the values from the stack it prints just 0s. If I try to print the array simpl

Longest Common Prefix in Javascript

I am trying to solve the Leet Code challenge 14. Longest Common Prefix: Write a function to find the longest common prefix string amongst an array of strings.

Loop or map array inside the JavaScript object

I have an array of javascript objects like: const arrayData = [ { name: "campaign 1", date: "2022-05-13", milestones:[{name:"Planning", targetDate: "2022-05-25"