Нужно ли обычную форму обратной связи лендинга защищать от спам-ботов?
Если да, что можете посоветовать?
10.1.11.1 OrdinaryOwnPropertyKeys ( O )
The abstract operation OrdinaryOwnPropertyKeys takes argument O (an Object) and returns a List of property keys. It performs the following steps when called:
1. Let keys be a new empty List.
2. For each own property key P of O such that P is an array index, in ascending numeric index order, do
a. Append P to keys.
3. For each own property key P of O such that P is a String and P is not an array index, in ascending chronological order of property creation, do
a. Append P to keys.
4. For each own property key P of O such that P is a Symbol, in ascending chronological order of property creation, do
a. Append P to keys.
5. 5. Return keys.
Const Addresses As String = "E7:E14,F7:F14,G7:G14,G21:G108,H7:H14"
Sub ...
...
For Each RangeAddress In Split(Addresses, ",")
Workbooks("srcX.xlsx").Sheets("SheetY").Range(RangeAddress).Copy Workbooks("dst.xlsx").Sheets("SheetZ").Range(RangeAddress)
Next
{ name: 'Вася', age: 25 }
function getAvarageAge(arr) {
return arr.reduce((sum, item) => sum + item.age, 0) / arr.length;
}
let vasya = { name: 'Вася', age: 25 };
let petya = { name: 'Петя', age: 30 };
let masha = { name: 'Маша', age: 29 };
let arr = [vasya, petya, masha];
console.log(getAvarageAge(arr)); // 28
// есть вариант применить рекурсию
const flatTree = (tree, childrenKey) =>
(tree instanceof Array ? tree : []).reduce((acc, n) => (
acc.push(n, ...flatTree(n[childrenKey], childrenKey)),
acc
), []);
// а можно обойтись и без неё
const flatTree = function*(tree, childrenKey) {
const stack = [];
for (let [ i, arr ] = this(tree); ++i < arr.length || stack.length;) {
if (i === arr.length) {
[ i, arr ] = stack.pop();
} else {
yield arr[i];
stack.push([ i, arr ]);
[ i, arr ] = this(arr[i][childrenKey]);
}
}
}.bind(x => [ -1, Array.isArray(x) ? x : [] ]);
v-for
по его значению:computed: {
users() {
// если использовать обычную функцию
return flatTree(this.elements, 'children');
// или, генератор
return [...flatTree(this.elements, 'children')];
},
},
<option v-for="n in users" :key="n.id">{{ n.name }}</option>