const reducer = (acc, val) => {
if (val.x) {
let key = val.x.slice(3); // получаем ключ вида mm.yyyy, если только mm надо, то val.x.slice(3, 5)
if (!key in acc) {
acc[key] = 0;
}
acc[key] += val.y;
}
return acc;
}
let result = array.reduce(reducer, {});
const openButton = document.querySelector(".profile__Info-button");
const closeButton = document.querySelector(".profile__buttonClose");
openButton.addEventListener("click", showForm);
closeButton.addEventListener("click", closeForm);
function showForm () {
document.getElementById("form").style.display = "flex";
}
function closeForm(e) {
document.getElementById("form").style.display = "none";
}
/* eslint-disable-next-line */
for (const arr of arrayOfLabel) {
import sha256 from 'crypto-js/sha256';
import hmacSHA512 from 'crypto-js/hmac-sha512';
import Base64 from 'crypto-js/enc-base64';
const message, nonce, path, privateKey;
const hashDigest = sha256(nonce + message);
const hmacDigest = Base64.stringify(hmacSHA512(path + hashDigest, privateKey));