constructor(myElement: ElementRef) { ... }
В гугле что на английском что на русском не нашел точной инфы на данный вопрос
Luhn algorithm 19
Good news is that the Luhn algorithm is not limited by the number of digits and can handle checks greater (and smaller) than 16 digits.
(function() {
let closed = false
$('#b1').click(() => {
!closed ? $('#d1').slideUp() : $('#d1').slideDown()
closed = !closed
})
})()
$('#b2').click(() => {
!$('#d2').hasClass('closed') ? $('#d2').slideUp() : $('#d2').slideDown()
$('#d2').toggleClass('closed')
})
var scrollPos = window.scrollY || window.scollTop || document.getElementsByTagName("html")[0].scrollTop;
if (scrollPos + window.innerHeight > el.centerY) addAnimation()
process.on('uncaughtException', err => {
console.error(err)
process.exit()
})
function arrayMin(arr) {
return arr.reduce(function (p, v) {
return ( p < v ? p : v );
});
}
function arrayMax(arr) {
return arr.reduce(function (p, v) {
return ( p > v ? p : v );
});
}
var array = [
{ base : 10, upOne: 2, upTwo: 5, upThree: 9}, // 26
{ base : 14, upOne: 1, upTwo: 3, upThree: 5}, // 23
{ base : 11, upOne: 2, upTwo: 3, upThree: 9} // 25
]
let selected = ['upOne', 'upTwo']
let getSum = (el) => {
let r = el.base
selected.forEach(i => r+= el[i])
return r
}
function arrayMin(arr) {
return arr.reduce(function (i, ac) {
return ( getSum(i) < getSum(ac) ? i : ac );
});
}
console.log(arrayMin(array))
async ()
async function test(v) {
return new Promise(resolve => {
setTimeout(() => {
console.log(v);
resolve();
}, 2000);
});
}
console.log('Start');
test(1);
console.log(2);
async function test2() {
await test(3);
console.log(4);
}
test2();
//2
//1
//3
//4