таймеры как шли так и идут
все данные как были так и есть
И если CryptoJS.SHA512("hello") возвращает корректный хэш строки "hello", то уже i = CryptoJS.SHA512(i) хэширует не строку hello, а инстанс объекта CryptoJS.
Ну и сформулирую вопрос более широко: как мне добиться того, чтобы результат кода исполняемого на C++ был идентичен результату кода исполненного на JS?
const arr = Array.from(
new Set(Array.from(document.querySelectorAll('.shop_name'), n => n.innerText)),
n => ({ name: n })
);
const arr = Object.values(Array.prototype.reduce.call(
document.getElementsByClassName('shop_name'),
(acc, { textContent: name }) => (acc[name] ??= { name }, acc),
{}
));
success: function(response){
setTimeout(function() {
document.location.href = `site.ru/test.php?number=${response.number}&name=${response.name}`;
}, 2000);
}
success: function(response){
localStorage.setItem('some_key', JSON.stringify(response.data));
setTimeout(function() {
document.location.href = 'site.ru/test.php';
}, 2000);
}
let helloHabr = JSON.parse(localStorage.getItem('some_key'));
[].toString() + true + false - null
"" + true // "true"
"" + true + false // "truefalse"
"" + true + false - null // NaN
+
не строка, то это не конкатенация и true, false, null будут преобразованы к числам.true + false - null + [].toString()
1 + 0 // 1
1 + 0 - 0 // 1
1 + 0 - 0 + "" // "1"
document.querySelectorAll('.slider__itm img').forEach(n => {
const link = document.createElement('a');
n.parentNode.append(link);
link.append(n);
});
for (const n of document.querySelectorAll('.slider__itm')) {
n.innerHTML = `<a>${n.innerHTML}</a>`;
}
for (const n of document.getElementsByClassName('slider__itm')) {
const link = document.createElement('a');
link.appendChild(n.replaceChild(link, n.children[0]));
}
const imgs = document.querySelectorAll('.slider__itm img');
for (let i = 0; i < imgs.length; i++) {
const link = document.createElement('a');
imgs[i].replaceWith(link);
link.insertAdjacentElement('afterbegin', imgs[i]);
}