let counter = 0;
$('.tableTicket').each((index, elem) => {
$(elem).append($(controls));
return counter++ < 10; // break loop when counter is 10
});
$('.tableTicket:nth-child(-n+10)').append($(controls));
const yourXp = 1001;
const yourPlaceByXp = users.reduce((place, user) =>
(user.xp > yourXp) ? place + 1 : place
, 1);
const arr = ['(sometext)', /([0-9]+)/g];
const re = new RegExp(`${arr[0]}|${arr[1].source}`, arr[1].flags);
Метод Object.getOwnPropertyNames() возвращает массив со всеми свойствами (независимо от того, перечисляемые они или нет), найденными непосредственно в переданном объекте.
convert temp.jpg -gravity North -pointsize 30 -annotate +0+100 'Love you mom' temp1.jpg
document.addEventListener('keypress', function(evt){
if (evt.code === 'F7') { // нажата кнопка F7
runSomething();
}
if (evt.code === 'KeyG') { // нажата кнопка G
runSomethingElse();
}
});
$('#mySelect2').val('1'); // Select the option with a value of '1'
$('#mySelect2').trigger('change'); // Notify any JS components that the value changed
button type="reset"