In an object of type DateTime , how do I get a new object object DateTime that represents the last day of the month of the first object?
var data = new Date(2017, 3, 1); // 01/03/2017
var dataUltimoDia = ??? // 31/03/2017
I searched a lot and could not find the functionality of do in JavaScript. Example:
function b(a, b) {
do a = a[b]; while (a && 1 !== a.nodeType);
return a
}
In object orientation there is SOLID, and one of the principles is the open / closed principle that I have learned as follows: "software components must be open for extension and closed for modification", where components include classes, methods...
The two forms below return True , but what are the consequences of this in a more complex code?
>>> a = '2'
>>> a is '2'
>>> True
>>> a == '2'
>>> True
I often see several programming languages where a ternary operation is almost always identical.
(x % 2 == 0) ? "par" : "impar"
However, when I tried to do this in Python, it gave me an error:
(x % 2 == 0) ? "par" : "impar"
^...
The JSON file format uses two types of symbols to organize the data in its structure, they are:
Brackets: [ ]
Keys: { }
In them you can enter values of several types, see this example example:
{
"Nome": "Ana",
"E...
I'm creating a text file and using some delimiters ( <# and #> ) I need to select what's inside the <# texto.delimitado #> delimiter. Using the split() JavaScript function.
What would be the best regular...
How to make the enter key not give submit on a form?
Example: in an input pressing enter nothing happens.
Today, if you press enter , the browser gives submit , and you clicked the submit button.
In PHP, is correct else if or elseif ? What's the difference between them?
The language allows you to write everything together and separate, and apparently the results are identical
How do I get the rest of the division (modulo % operation) to decimal places when I use a divisor or float dividend?
Example:
echo 5 % 3; // imprime 2 como é esperado
echo 5.6 % 3; // imprime 2 quando deveria imprimir 2.6
...