const result = data.reduce((acc, curr) => {
const {category, family, symbol, id} = curr;
acc.category[category] = acc.category[category] || {family: {}};
acc.category[category].family[family] = acc.category[category].family[family] || {symbol: {}};
acc.category[category].family[family].symbol[symbol] = acc.category[category].family[family].symbol[symbol] || {id: []};
acc.category[category].family[family].symbol[symbol].id.push(id);
return acc;
}, {category: {}});
async function setStat(data) {
const {status} = data.body;
// ...
return status;
}
module.exports = {setStat};
let foo = require('../controllers/foo');
async function main() {
let out = await foo.setStat(data);
console.log(out);
}
const str = 'У Миши 2 яблока';
const newStr = str.replace('Миши', 'Саши');
и зачем здесь jquery? (Sender as TButton).OnClick := TForm1.foo;
TForm1 = class(TForm)
Button1: TButton;
class procedure foo(Sender: TObject);
// ...
var bod = document.getElementById('main_info');
var elem = bod.querySelector('#one');
for (var i = 0; i => fields; i++) {
for (var i = 0; i < fields.length; i++) {
? func1() {
return this.setJson();
}
async func2() {
let q = await this.func1();
return q;
}