Questions tagged as 'objetos'

1
answer

How to traverse an object and filter this object?

I'm trying to navigate an object and after that, filter the same. I'm using this code, but it's not working. Can anyone help me and if possible explain the code? const objeto = { idade: 20, idade:20, idade:21}; const funcao =...
asked by 22.01.2018 / 19:25
2
answers

How to reuse data in a class without having to repeat this data?

How to reuse $dados , $key and $postFields on all methods without having to repeat this data every time within each method? Yes, these variables will always have the same values. class AllImoveis { /** * Chaves de...
asked by 26.12.2015 / 13:46
2
answers

How to assign all the characteristics of one object to another, least one in particular?

I'm creating a card game that runs in the browser and I need in some situations, there may be the same cards in different hands ("Computer" or "Player"). However, I do not want to have to create another object to represent the enemy cards. This...
asked by 23.05.2018 / 21:55
2
answers

How to check if an object has a string?

I have the following problem, I need to check if an object has a certain string, this object comes from the google places API autocomplete. This is a return json, for example: { "address_components": [{ "long_name": "1219", "short_n...
asked by 06.11.2017 / 14:50
2
answers

Transform array of objects into just one array

I have a array with multiple objects : array(3) { [0]=> object(stdClass)#5750 (2) { ["value"]=> string(16) "[email protected]" ["key"]=> string(18) "email_client" } [1]=> object(stdClass)#5254 (2) {...
asked by 04.11.2016 / 19:30
1
answer

Array that is becoming object [closed]

When using the json decode function in a json, I'm having a problem. When the numbering is perfectly in order (0,1,2,3 ...) it is classified as arra: [2016-08-01] => Array ( [0] => 07:00:00 [1] => 07:20:00...
asked by 20.07.2016 / 19:31
2
answers

How do I adapt this function to function without needing the element ID?

I have a function and I want to adapt it to work without needing the element ID ( document.getElementById("slides"); ). I saw that it is possible to do this using the NEW operator, but I had difficulties. Do you have any practical e...
asked by 28.06.2016 / 13:05
1
answer

When instantiating and when not instantiating the object? [duplicate]

I've learned a lesson from PHP that you can use a class in two ways, without instantiating instantiating the object . // Forma 1 echo SEO_URL::Strip('Caçador mata leão na selva'); // Forma 2 $url = new SEO_URL(); $url->Strip('Ca...
asked by 01.11.2015 / 15:14
2
answers

For in an ArrayList of Java Objects

I'm studying Java and I'm having a problem with a code I wrote. Home I need to read the name and age of 3 people and say the name of the youngest and the name of the oldest. Home I know the best way for a large number of people would be to use t...
asked by 23.03.2015 / 14:45
1
answer

Capture information and use when you need Java

I'm thinking of implementing a function that captures the logged in user, I still can not figure out how I can implement that function, I'd like to know what's usual and conducive for me to record the user's name and code while the software runs...
asked by 12.06.2015 / 15:40