var rowNumber = 0;
var colNumber = 1;
var x = A.filter(function (val, ind) {
return ind !== rowNumber;
}).map(function (val) {
return val.filter(function (val, ind) {
return ind !== colNumber;
});
});
// ЭТОТ КОД ТОЛЬКО ДЛЯ ДЕМОНСТРАЦИИ. НЕ ПИШИТЕ ТАК
if (timerId) {
return true;
} else {
return false;
}
var a = 10;
var b = !a; // false, т.к. 10 это true, а !true это false (т.к. ! - знак отрицания).
var c = !b; // !false == true
c === !!a // true, т.к. !!10 === !false === true
c === !b; // true, т.к. !(!a) === !!a === !!10 === !false === true
price[catName][productName]
<li class="calculator calculator--checked" data-category="meat" data-value='свинина'>свинина</li>
getPrice(t){
let item = t.closest('.wrap').querySelectorAll('.calculator--checked');
this.arr = [];
let totalPrice = 0;
for(let i = 0; i < item.length; i++){
let product = item[i].getAttribute('data-value');
let category = item[i].getAttribute('data-category');
totalPrice += +price[category][product];
}
return totalPrice; // в totalPrice итоговая цена.
}
let product = item[i].dataset.value; // префикс data- упускаем.
item[i].dataset.categoryName
item[i].dataset['category-name']
<script src="путь" defer></script>
document.addEventListener("DOMContentLoaded", function(event) {
// документ готов, можно работать!
});
getValueForInput() {
this.onHandleFetch(this.props.params.idValue); // передача id
console.log(this.state.data); // здесь не выводятся данные
return this.state.data.value; // тут тоже не получается значение, т.к. onHandleFetch его еще не успел подготовить
}
synacs.json[3] = {};
synacs.json[3].id = '222';
synacs.json[3].date = '20:50';
synacs.json[3].datem = '1539453040269';
synacs.json[3].num = '552';
synacs.json[3].comment = 'fuck off';
synacs.json[3].active = '1';
synacs.json.push({
id: '222',
date: '20:50',
//....
});
if (window.NodeList && !NodeList.prototype.forEach) {
NodeList.prototype.forEach = function (callback, thisArg) {
thisArg = thisArg || window;
for (var i = 0; i < this.length; i++) {
callback.call(thisArg, this[i], i, this);
}
};
}
width = xEnd - xStart;
height = yEnd - yStart;
const PATHS = new function () {
this.src = 'src';
this.srcAssets = this.src + '/assets';
}
const PATHS = (function () {
const basePath = 'src';
return {
src: basePath,
srcAssets: basePath + '/assets',
};
})();