{"id":10667,"customerPhone":"7928...","totalSum":300.0,"positions":[{"sum":300.0,"totalSum":300.0,"qnt":2.0,"product":"faca4124-15ed-4947-9961-94528187169a","discount":15.0,"bonusDebit":0.0,"bonusCredit":10.0,"cat":"Напитки","price":150.0}]}
{"id":10667,"customerPhone":"7928...","totalSum":300.0,"positions":[{"sum":300.0,"totalSum":300.0,"qnt":2.0,"product":"faca4124-15ed-4947-9961-94528187169a","discount":15.0,"bonusDebit":0.0,"bonusCredit":10.0,"cat":"Напитки","price":150.0}]}
setcookie('discountCardNumber', '', time(), '/', 'example.ru');
setcookie('discountCardNumber', $dicount_card_number, time()+60*60*24*30*12*10, '/', 'example.ru');
add(value){
// ajax-запрос
// прочие вычисления
// обновление хранилища (данные получены путём вычислений в этой же функции)
}
var Animal = function(){
this.run = function(){
console.log("I am running or swimming...");
};
}
var Mammal = function(){
this.run = function(){
console.log("I am running!");
};
this.voice = function(){
console.log("...");
};
};
Mammal.prototype = new Animal();
Mammal.prototype.constructor = Mammal;
var Cat = function(){
this.voice = function(){
console.log("Meow!!!");
};
};
Cat.prototype = new Mammal();
Cat.prototype.constructor = Cat;
var DomesticCat = function(){
this.height = "80";
this.weight = "30";
}
DomesticCat.prototype = new Cat();
DomesticCat.prototype.constructor = DomesticCat;
var Dog = function(){
this.height = "100";
this.weight = "50";
this.play_with_cat = function(){
console.log("I am playing!");
};
}
Dog.prototype = Mammal.prototype;
Dog.prototype.constructor = Dog;
var cat1 = new DomesticCat();
//var dog1 = new Dog();
console.log(cat1 instanceof Dog); // true
//console.log(dog1 instanceof Cat); // false
console.log(cat1);
//console.log(cat1);
DomesticCat {height: "80", weight: "30"}
height:"80"
weight:"30"
__proto__: Cat
voice: ƒ ()
__proto__: Dog
constructor: ƒ ()
run: ƒ ()
voice: ƒ ()
__proto__: Animal
constructor: ƒ ()
run: ƒ ()
__proto__: Object