Используется ли Vue в крупных проектах и вообще используется ли?
стоит ли начинать знакомится с фреймворками начиная с Vue
интересует будет ли потом работа и вообще не падет ли он
var numberOfCalls = 0;
return function() {
return ++numberOfCalls;
}
const test = [
[2, 7, 2],
[2, 5, 4],
[2, 1, 5],
[3, 1, 2]
]
const concat = [].concat(...test)
const min = Math.min.apply(null, concat)
const index = concat.findIndex(e => e === min)
alert(`test[${Math.floor(index / 3)}][${Math.floor(index % 3)}]`)
const groups = [
{ id: 1, name: 'group 1', items_ids: [1, 2, 4] },
{ id: 2, name: 'group 2', items_ids: [8, 2, 3] },
{ id: 3, name: 'group 3', items_ids: [12, 1] },
{ id: 4, name: 'group 4', items_ids: [] },
{ id: 5, name: 'group 5', items_ids: [] },
]
const result = groups
.filter(group => group.items_ids.length > 0)
.reduce((prev, next, i, acc) => prev.concat(next.items_ids), [])
console.clear()
console.log(result) // [1, 2, 4, 8, 2, 3, 12, 1]
console.log([...new Set(result)]) // [1, 2, 4, 8, 3, 12]
let dictionary = {
'Hello': 'Привет',
'Bye': 'Пока'
}
dictionary = new Proxy(dictionary, {
get(target, phrase) {
if (phrase in target) {
return target[phrase]
} else {
console.log(`No phrase: ${phrase}`)
return phrase
}
}
})
// Обращаемся к произвольным свойствам словаря!
alert( dictionary['Hello'] ) // Привет
alert( dictionary['Welcome']) // Welcome (без перевода)