I have a Person class and a Date class, the Person class creates a person the date class creates a date to use as the date of birth in the Person class, how is it that when creating a Person I create a date without having to use the code complet...
Objects are arrays in JavaScript? I have difficulty understanding how this is possible:
var obj = {
title: 'some value'
}
console.log(obj['title']); // some value
In my conception the use of brackets is only possible in lists to pass a...
Let's suppose I have a function:
std::string empty_string() {
std::string x{ "" };
return x;
}
As much as it seems normal, it gets kind of confusing when we think:
When the destructor of object x is called?
Please no...
How does the search for information through the sender object work, and in what situations can I use it, with what types of events?
This is to avoid redundancy of events. Where can I explore these possibilities?
For example :
several buttons fro...
I have a x variable with the following content inside:
x = [ {
id: '1',
name: 'name,
} ]
And I thought that to access id was x.id , but it is not so. How to access?
I need to list objects and I have used the following function that is in jQuery. Is there an alternative to this in JavaScript only?
$.each(object, function(index, value) {
console.log(value);
});
In Javascript, when I need to do a reduction operation, I use the Array.reduce method.
So:
var valores = [1, 2, 3, 4, 5, 1000];
var resultado = valores.reduce(function (soma, atual) {
return soma + atual;
})
console.l...
I'm trying to understand why the native java mode is not comparing, I do not know where I'm going wrong.
MAIN
// EXERCICIO PARA COMPARAR DOIS OBJETOS, USANDO CLASSE NATIVA DE COMPARAÇÃO DO JAVA
public static void main(String[] args) {...
I received a response that spoke about a syncblock . Why is it necessary?
From what I understand, what I researched is competition control. But why does every object need it if not everyone will have competition?
I'm trying to create an object where its methods can not be changed. That is, its value, even if changed, should continue as initially defined.
Example:
var object = (function(object){
object.method = function (text) {
retu...