$json = file_get_contents('php://input'); ! - это булево отрицание. И он приводит свой аргумент к типу boolean. Автор не открыл Америку, и это используется. Но использовать нужно с умом.false - это undefined, null, '' (пустая строка), 0, 0n (bigint 0), NaN.!! - это всего лишь 2 идущих подряд оператора !, это такое популярное сокращение для быстрого каста к boolean.!!!, но это бессмысленно, так как тройное отрицание даст тоже самое что и одинарное.
db.Clients.find({}).forEach(el => {
db.Clients.updateOne({ _id: el._id }, { $set: { phone: [el.phone] }})
}) default_server) запросы, в т.ч. по прямому IP:server {
listen 80 default_server;
server_name _;
return 444;
}Здесь _ подчеркивание — не что-то волшебное, просто несуществующее имя домена.
// получаем атрибут
const color = el.getAttribute('data-color');
// устанавливаем его
el.classList.add(color); filter.update.country() this является объект update, а не filter.class Filter {
static sex = null;
static player = null;
static country = null;
static updateSex() {
Filter.sex = document.querySelector("#sex").value;
}
static updatePlayer() {
Filter.player = document.querySelector("#player").value;
}
static updateCountry() {
Filter.country = document.querySelector("#country").value;
}
}
Filter.updatePlayer();
console.log(Filter.player);class Filter {
constructor() {
this.sex = null;
this.player = null;
this.country = null;
}
updateSex() {
this.sex = document.querySelector("#sex").value;
}
updatePlayer() {
this.player = document.querySelector("#player").value;
}
updateCountry() {
this.country = document.querySelector("#country").value;
}
}
const filter = new Filter();
filter.updateCountry();
console.log(filter.country);class Filter {
fields = {
country: null,
}
update = {
caller: this,
country() {
this.caller.fields.country = "123";
}
}
}
const filter = new Filter();
filter.update.country();
console.log(filter.fields.country);
Зависит ли это от стека технологий?
Может быть есть какие нибудь специальные тесты для проверки этого?