function d() {
var arrN = [];
for (var i = 0; i < 7; i++) {
arrN[i] = (Math.round(Math.random() * (300 - 100) + 100));
}
return arrN;
}
console.log(d());
function duplicateEncode(word){
let lowerCaseWord = word.toLowerCase(),
newWord = "";
for (let i = 0; i < word.length; i++) {
if (lowerCaseWord.lastIndexOf(lowerCaseWord[i]) == lowerCaseWord.indexOf(lowerCaseWord[i])) {
newWord += ")";
} else {
newWord += "(";
}
}
return newWord;
}
let tab = document.querySelectorAll('.page-services-item'),
info = document.querySelector('.page-services-list'),
tabContent = document.querySelectorAll('.services-list__wrap'),
titleTab = document.querySelector('.page-services-title__wrap');
info.addEventListener('click', function(event) {
let target = event.target;
if (target && target.classList.contains('page-services-item')) {
for(let i = 0; i < tab.length; i++) {
if (target == tab[i]) {
let content = tab[i].innerHTML;
titleTab.innerHTML = content;
tab[i].classList.add('hide'); ///Вот тут на определённую ссылку из массива я навешиваю класс
hideTabContent(0);
showTabContent(i);
} else {
tab[i].classList.remove('hide');
}
}
}
})
let obj = {
"BIRZHASP":[
{
"Code":"1",
"ForAbonentType":"ip"
},
{
"Code":"2",
"ForAbonentType":"ul"
}
],
"BIRZHASPF":[
{
"Code":"3",
"ForAbonentType":"ip"
},
{
"Code":"4",
"ForAbonentType":"ul"
}
]
};
let arr = [
{
serviceTypes: ['BIRZHASP', 'BIRZHASPF']
qualNames: {
ip: какой то код
ul: какой-то код
};
}
];
arr.foreach(elem => {
elem.serviceTypes.forech(e => {
if (obj.hasOwnProperty(e)) {
elem.qualNames.ip = obj[e][0].ForAbonentType;
elem.qualNames.ul = obj[e][1].ForAbonentType;
}
});
});
div {
-webkit-touch-callout: none; /* iOS Safari */
-webkit-user-select: none; /* Chrome/Safari/Opera */
-khtml-user-select: none; /* Konqueror */
-moz-user-select: none; /* Firefox */
-ms-user-select: none; /* Internet Explorer/Edge */
user-select: none; /* Non-prefixed version, currently
not supported by any browser */
}