'customData' => array(
array(
'customValue' => array(
array(
'id' => 13850,
'value' => $visit
)
),
),
array(
'customValue' => array(
array(
'id' => 13852,
'value' => $id
)
),
),
array(
'customValue' => array(
array(
'id' => 13854,
'value' => $ga
)
)
)
)
function renderObj(e) {
e.preventDefault();
let str = '';
let inputKey = document.querySelector('.input-key').value;
let inputValue = document.querySelector('.input-val').value;
if (inputKey !== '' && inputValue !== '') {
obj[inputKey] = inputValue;
for (let key in obj) {
str += `Ключ: ${key}, Значение: ${obj[key]} <br>`
}
}
output.innerHTML = str;
document.querySelector('.input-key').value = '';
document.querySelector('.input-val').value = '';
}
$('#elem').click((() => {
// Основное тело функции будет исполнено один раз при установке обработчика
// Таким образом создастся замыкание для переменной count
let count = 0;
// А вот здесь уже вернётся настоящий обработчик клика,
// который будет вызваться при каждом нажатии
return () => {
count++;
console.log(count)
};
})());
$('#elem').click(() => {
let count = 0;
count++;
console.log(count);
});
"use strict";
let aa = [[2020,'01','01'],[2019,'01','01']];
console.log(aa[1][1]);
<button type="button" value="+">+</button>{el.quantity}<button type="button" value="-">-</button>
<input type="hidden" name="status" value="0">
<input type="checkbox" name="status" value="1" id="status" class="form-check-input">
<Route exact path="/goods" component={ Goods } />
<Route exact path="/goods/new" component={ NewGood } />
<Route path="/goods/:id" component={ Details } />