const div = document.createElement('div');
div.innerHTML = str;
const arr = Array.prototype.map.call(div.children, n => n.outerHTML);
const arr = Array.from(
new DOMParser().parseFromString(str, 'text/html').body.children,
n => n.outerHTML
);
const arr = [];
for (const n of document.createRange().createContextualFragment(str).children) {
arr.push(n.outerHTML);
}
let number = 0b1101;
const count = [ 0, 0 ];
do {
count[number & 1]++;
} while (number >>= 1);
count.forEach((n, i) => console.log(`${i}: ${n}`));
const count = [...number.toString(2)].reduce((acc, n) => (++acc[n], acc), [ 0, 0 ]);
string s = " qwerty\n\
asdfgh\n\
zxcvbn";
string s = R"( qwerty
asdfgh
zxcvbn)";
У меня 2 предположения:
1. Я что-то делаю не так
2. Я не хорошо ознакомился с Vuex...
По сути у меня два компонента получилось upload-files и edit-file . И надо теперь наладить между ними взаимодействие.
var lastCharacter = ';';
$('input').on('input', function() {
var val = this.value;
if (val && val[val.length - 1] !== lastCharacter) {
$(this).val(val + lastCharacter);
}
});
я что-то не так делаю видно
const a = v1 => {
const f = v2 => a(v1 + v2);
f.valueOf = () => v1;
return f;
};
a(1)(2)(3)(4)(5) * 6 // 90
10 + a(4)(5)(6) // 25
Math.pow(a(8)(1), 3) // 729
a(4)(6) - a(3) // 7