const arr = [
{
id : 1,
city : "Москва",
title : "ООО Мавзолей",
type : ["носки", "аромат"]
},
{
id : 2,
city : "Татарск",
title : "ООО Татарск Продакс",
type : ["коровы", "ЖБ плиты"]
}
];
const filter = {
city: `Татарск`,
title: ``,
type: `коровы`
};
const data = arr.filter(item => {
const title = filter.title === "" ? item.title : filter.title;
return (item.city === filter.city && item.title === title && item.type.includes(filter.type)) ? item : null;
});
console.log(data);
var child = require('child_process').execFile;
var executablePath = "C:\\Program Files (x86)\\Mozilla Firefox\\firefox.exe";
child(executablePath, function(err, data) {
if(err){
console.error(err);
return;
}
console.log(data.toString());
});
const times = [];
let fps;
function refreshLoop() {
window.requestAnimationFrame(() => {
const now = performance.now();
while (times.length > 0 && times[0] <= now - 1000) {
times.shift();
}
times.push(now);
fps = times.length;
refreshLoop();
});
}
refreshLoop();