Questions tagged as 'array'

1
answer

Read value of an array json_encode laravel

I did a query to the database ( BD ) which then transforms by means json_encode() to show it in the view blade and the result is this: [{"monto":"44"},{"monto":"0"},{"monto":"5640"},{"monto":"0"},{"monto":"0"},{"mont...
asked by 27.11.2017 / 17:14
1
answer

Because the error Can not read property '0' of undefined in a two-dimensional array

Hello everyone I have the Error mentioned when I want to store data, I keep in a coordinate arrangement and then when I want to store it, it says Error . //Declaracion de variables var coordinates = []; var valid = 1; function ad...
asked by 28.11.2017 / 02:11
1
answer

Show colors of an array in JavaFx

I have this little program in JavaFx that goes through the image and shows me all the colors it has, in the table next I show the color code, but I want to show the visible color and not the code and I wanted to know how I could fill each cel...
asked by 02.12.2017 / 03:37
1
answer

Creating an Array object with jQuery

Greetings community how are you doing? this time I come with a concern about arrays, it turns out that I'm creating an array from an event in a specific cell of a Datatable, I need to click on an ID field that I have in the datatable, all the da...
asked by 12.12.2017 / 20:46
2
answers

Array containing objects created in JavaScript, how to display the contents of the array in an HTML div?

The fact is that I have this function that creates objects of the Person class and stores them in an array. I create it correctly, the problem I have is that I want to show the value of the object created in an HTML div. This is the constructor...
asked by 19.11.2017 / 18:17
1
answer

Game seven and a half JS

I'm doing the seven-and-a-half game in JS, for the moment I'm trying to show on the screen when I press a button a random card and its punctuation, that is, the number one will be worth 1 point, the number 2 2 points, so succesivamente, I need a...
asked by 10.11.2017 / 19:12
2
answers

fill an array with default values if it does not exist

Hello Good evening, I have this code $total = array(); $months = array(1,2,3,4,5,6,7,8,9,10,11,12); foreach ($months as $value) { foreach ($total_clients as $clientes) { if($value == $clientes->month){ $total[$value...
asked by 10.11.2017 / 06:20
2
answers

Store a multidimensional array in a variable without knowing how many rows it will get (Javascript)

reviewing one of the freecodecamp algorithms in which we work with javascript I have the following code: function largestOfFour(arr) { var largestNumber = [0,0,0,0]; for(var arrayIndex = 0; arrayIndex < arr.length; arrayIndex++) { for(va...
asked by 07.11.2017 / 11:47
1
answer

Text in bold and normal in an item of an array [duplicated]

good to all. I'm trying to implement an idea that may not be possible, since I can not find any information anywhere. I have an array with several items, my idea is that the strings of those items appear the first word of it in bold and the...
asked by 27.10.2017 / 22:58
1
answer

insert the checkbox values that are selected in accordance? [duplicate]

My CH is connected to a field in the database, as the values that are selected are inserted into an array?     
asked by 29.11.2017 / 19:00