The simplest example to put it better is with an arrow functionsuma
const suma = ({a, b}, c) => a + b + c;
console.log(suma({ a:10, b:17}, 100)); // 127
or How does a separate argument work?
The simplest example to put it better is with an arrow functionsuma
const suma = ({a, b}, c) => a + b + c;
console.log(suma({ a:10, b:17}, 100)); // 127
or How does a separate argument work?
When used Node.js
to import a class it would be:
var Comprobador = require('./comprobador.js');
let comprobador=new Comprobador();
But in pure JavaScript on the client side, how would it be?
I want to know if in this JSON:
"salmos": [{
"orden": "1",
"antifona": "Han llegado los días de penitencia; expiemos nuestros pecados y salvaremos nuestras almas.",
"ref": "Salmo 118, 17-24",
"tema": "NULL",
"intro": "NULL",
"parte": "NULL",
"salmo": "Haz bien a tu siervo: viviré_y cumpliré tus palabras;_ábreme los ojos y contemplaré_las maravillas de tu voluntad;_soy un forastero en la tierra:_no me ocultes tus promesas.§Mi alma se consume, deseando_continuamente tus mandamientos;_reprendes a los soberbios,_infelices los que se apartan de tus mandatos;_aleja de mí las afrentas y el desprecio,_porque observo tus preceptos.§Aunque los nobles se sientan a murmurar de mí,_tu siervo medita tus leyes;_tus preceptos son mi delicia,_tus decretos son mis consejeros."
}, { ...
values that appear like this: "NULL"
, would be interpreted as a string whose value isNULL
, or would be interpreted as the value NULL
itself .
The doubt came to me because I don't know if I could have problems when retrieving any of those values, which can be a valid string, or an empty string that I wanted to represent as NULL
for greater security.
When we create a table and define an integer data type , we may define a specific length. For example:
SMALLINT(5)
,INT(11)
, eitherBIGINT(20)
Why is this length defined in an integer data type?
I am performing the operator overload = for a Rational data type. That is, for this to work with the Rational type:
res = p;
According to the book I'm following, it tells me to do it with the = operator as a member function (method) and:
- Receive a type by reference.
- That I create an object with the copy constructor, passing it as a parameter the object received in said function.
- Let it swap that created object for the *this.
- Which returns *this.
Implementing it, and working there are no problems (it works perfectly) with the version I have made, which would be this (correct me if it is not correct):
Racional& Racional::operator=(const Racional& der)
{
Racional auxiliar(der);
this->numerador = auxiliar.obtenerNumerador();
this->denominador = auxiliar.obtenerDenominador();
return *this;
}
My question is the following. Why do I have to create a helper object if I can directly do:
Racional& Racional::operator=(const Racional& der)
{
this->numerador = der.obtenerNumerador();
this->denominador = der.obtenerDenominador();
return *this;
}
Thank you very much for everything comrades.