I have two sheets in Google Sheets. Is it possible to always match two cells? For example Sheet1!A1 with Sheet2!A1 in such a way that if I change the value in Sheet1!A1 the value in Sheet2!A1 changes and if I change the value in Sheet2!A1 it changes in Sheet1!A1
Home
/
user-88399
Felipe Jiménez Prieto's questions
Felipe Jiménez Prieto
Asked:
2020-05-25 14:54:29 +0800 CST
They ask us to carry out this exercise and I have some doubts about inheritances.
My solution that I don't know if it's correct
function Animal(nombre, especie, numPatas, cola) {
this.nombre = nombre;
this.especie = especie;
this.numPatas = numPatas;
this.cola = cola;
this.getNombre = function () {
return this.nombre;
}
this.setNombre = function (nombre) {
this.nombre = nombre;
}
//skip the other getters and setters
function Vaca(nombre, especie, numPatas, cola, leche) {
Animal.call(this, nombre, especie, numPatas, cola);
this.leche = leche;
Vaca.prototype.ordeñar = function (leche) {
this.leche = this.leche - 1;
}
Vaca.prototype.getLeche = function () {
return this.leche;
}
Vaca.prototype.setLeche = function (leche) {
this.leche = leche;
}
}
Vaca.prototype = new Animal();
function Tigre(nombre, especie, numPatas, cola, numVictimas) {
Animal.call(this, nombre, especie, numPatas, cola);
this.numVictimas = numVictimas;
Tigre.prototype.getNumVictimas = function () {
return this.numVictimas;
}
Tigre.prototype.setNumVictimas = function (numVictimas) {
this.numVictimas = numVictimas;
}
Tigre.prototype.comerPersonas = function (numVictimas) {
this.numVictimas = this.numVictimas + 1;
}
}
Tigre.prototype = new Animal();
The question arises as to whether inheritance is correct and what difference would it make, for example, with prototype
function Animal(){
this.nombre = nombre;
this.especie = especie;
this.numPatas = numPatas;
this.tieneCola = tieneCola;
}
Animal.prototype.getNombre = function(){
return this.nombre;
}
Animal.prototype.setNombre = function(nombre){
this.nombre = nombre;
}